PHP Coalface

Here's the main RSS feed from phpdeveloper.org:

PHPDeveloper.org
Site News: Popular Posts for This Week (05.26.2017) on 26 May 2017

Popular posts from PHPDeveloper.org for the past week:

SitePoint PHP Blog: Re-Introducing Symfony Console – CLI PHP for the Uninitiated! on 25 May 2017

The SitePoint PHP blog has posted a tutorial from author Claudio Ribeiro that wants to , a component of the larger Symfony framework that makes it easier to create and work with command-line PHP scripts.

As software developers, we often feel the need to resort to command line tools. These kinds of tools are helpful when we need to do a sort of recurring task like migrating data, performing imports, or creating cron jobs.

The component tool provides us with a simple framework to create our own command line tools. Unlike many components in Symfony, this is a standalone package and is used by the likes of ‘s Artisan and many other famous PHP packages.

The tutorial then walks you through the installation process, via Composer, and the creation of a new command. With this simple base created, he then adds in actual functionality, building out a command to hash and verify a password string. They show how to use the command and an example of its output. Next up, he creates another command example, this time verifying the password hash provided as an argument. The tutorial wraps up with a look at testing your console comamnds with PHPUnit tests via the included CommandTester functionality.

Sebastian De Deyne: TypeScript With Laravel Mix on 25 May 2017

In a post to his site Sebastian De Deyne shows how to right alongside other packages and libraries included in your mix configuration.

In a recent project we decided to give a shot for the business critical part of a new application. TypeScript provides static analysis to reduce the chance of introducing bugs, to have self-documenting code, and to improve our tooling (autocompletion!)

We've been happily using since it's release with Laravel 5.4. Luckily, extending Mix isn't too hard with some webpack knowledge. [...] As long as you've configured an appropriate loader, you could import anything from a plain old JavaScript file to an animated gif. This means that if we want to support TypeScript with Laravel Mix, we don't need to change any configuration, we only need to add the ability to bundle TypeScript files.

The remainder of the article is broken down into the four steps (and a bonus) for getting Mix and TypeScript playing together nicely:

  • Install The Necessary Dependencies
  • Configure TypeScript
  • Configure Laravel Mix
  • Write Some TypeScript!

The bonus at the end shows how to use this working setup to go one step further and use TypeScript in the Vue.js components in your Laravel application.

thePHP.cc: Testing Keeps Me From Getting Things Done on 25 May 2017

On thePHP.cc site they have a new post that tries to refute a common claim from developers when it comes to testing: . The post is a response to an email to the group about testing asking where the real value is in applications versus libraries/tools.

To successfully develop software means to work target-oriented. These targets should be derived from acceptance criteria that are reconciled with the business. Without clear targets – we mean at a task level, not project or annual targets – the developer runs the risk of getting lost in work. Most importantly, he does not know when he is done with a task.

It is prudent to document and verify acceptance criteria through automated tests. One way or another, the targets have to be defined before production code gets written. This is test-driven development, whether you want to call it that or not.

The response goes on to talk about how, with tests written after the code has already been written (legacy code), it's not always clear what the original intent was resulting in lost context. It also compares two of the main types of testing - integration and unit - and the place each has in an overall testing strategy.

Site News: Blast from the Past - One Year Ago in PHP (05.25.2017) on 25 May 2017

Here's what was popular in the PHP community one year ago today:

Also from phpdeveloper.org, here are some Security links:

No channel data


Comments

It's quiet in here...Add your comment