Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jason McCreary:
Practicing YAGNI
Aug 10, 2016 @ 10:18:33

Jason McCreary has written up a post covering a popular topic from the eXtreme programming world, a talk he presented on the subject and a bit of his own personal experiences with it: YAGNI or "You Aren’t Gonna Need It".

Last week I spoke at Laracon US 2016 about Practicing YAGNI. First, let me say it was an honor to present for such a large audience at such a premiere conference. I received a lot of feedback and interest in my talk. To that point, many people have asked me to share my slides. As the slides were mostly placeholders for discussion, I felt a blog post would better summarize the talk.

[...] YAGNI is a principle of eXtreme Programming - something I practice daily at work. YAGNI is an acronym for You Aren’t Gonna Need It. It states a programmer should not add functionality until deemed necessary. In theory, this seems straightforward, but few programmers practice it.

He talks about practicing YAGNI and why it's hard for the average developer. He starts with the overall problem it solves and the more relatable KISS (Keep it simple, stupid) and MVP (minimum viable product) realms of thought. He then gets into some of the ways that you can practice YAGNI in your own development, mostly dealing with the timing of feature development rather than complexity. He also includes some times when it doesn't make sense to practice YAGNI and, finally, what practicing it means to him personally.

tagged: yagni yaaintgonnaneedit development principle extreme programming opinion

Link: http://jason.pureconcepts.net/2016/08/practicing-yagni/

Symfony Finland:
PHP development with Windows Subsystem for Linux (WSL)
Aug 08, 2016 @ 09:48:19

On the Symfony Finland site there's a new article posted talking about the use of the Windows subsystem for Linux, an environment that allows for the execution of Linux binaries in a Windows environment.

Windows has always been somewhat of an oddball when it comes to PHP development. In the past years it has lost out on developer mindshare to UNIX-like Operating Systems like Linux and macOS.

With the release of Windows 10 Anniversary Update in August 2016 Microsoft now offers an interesting option for PHP development in the Windows environment: The Windows Subsystem for Linux (WSL). The Windows Subsystem for Linux allows the execution of Linux binaries in Windows 10. The feature is not enabled by default and is targeted for developers.

They show you how to get into the Linux-compatible shell on your Windows system after enabling it in your System Settings. From there, he says, it's basically like working in a Linux-based server and includes some of the actions he took (including installing PHP 7, Symfony and Composer). He also shows the integration the environment has back with the Windows system including access to local drives (but that there's still some tricky bits involved in using them).

tagged: development windows subsystem linux commandline install symfony environment

Link: https://www.symfony.fi/entry/php-development-with-windows-subsystem-for-linux-wsl

7PHP.com:
What Secret Tools Does The Grumpy Programmer ‘Chris Hartjes’ Harness, To Be So grumpy?! It
Jul 20, 2016 @ 10:05:21

On the 7PHP.com site there's a new interview posted in their "It's the Tools Talking" series , this time with Chris Hartjes a.k.a. the "Grumpy Programmer". In the interview Khayrattee Wasseem asks Chris about some of his "tools of the trade" he uses in his everyday work.

In this #2nd edition, I’m overwhelmed but also quite ‘on my guard‘ as I talk with The Grumpy PHP Programmer aka Chris Hartjes – the #unitTesting rockstar of our beloved PHP Community. If you don’t know Chris, I’ll tell you in one line: “He’s The Eric Cantona of Manchester United” (full stop). Never heard of Cantona as well? Tough luck you’ve been too much focused on Go Pokémon GO (huh?), have a read about The Rockstar Unit Testing Evangelist Chris in this interview which I did with him back on the 19th Jan 2012 – yup that long time ago, but equally evergreen in everything! ????

In the interview Chris answers questions about:

  • himself and his involvement in the PHP community
  • what his workstation is like
  • what OS/VM software he uses
  • tools he uses for documentation, code beautification and time management

He ends the interview talking about two "community tools" he sees as the most important in the PHP ecosystem right now: Composer and Twitter (well, the community of PHP developers there).

tagged: itsthetoolstalking 7php interview chrishartjes grumpyprogrammer tools development

Link: http://7php.com/itsthetoolstalkingwith-grumpy/

PHP.net:
PHP 7.1.0 Alpha 3 Released
Jul 08, 2016 @ 12:57:39

The PHP development group has officially announced the release of the latest alpha in the PHP 7.1.x series: PHP 7.1.0 Alpha 3. This is a preview release and should not be used for production applications.

The PHP development team announces the immediate availability of PHP 7.1.0 Alpha 3. This release is the last alpha for 7.1.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

This release includes new features including an Iterable type, HTTP/2 server push support, creating closures from callables and more precise float values. You can see the full list of additions and changes in the NEWS and UPGRADING files. If you're interested in trying out this latest alpha, you can get the latest source release from here and the Windows binaries here.

tagged: language release alpha php7 preview development

Link: http://php.net/index.php#id2016-07-07-1

Freek Lijten:
Final, private, a reaction
Jun 21, 2016 @ 10:39:37

In response to a few other posts about the use of "final" in PHP development, Freek Lijten has posted some of his own thoughts and some of the things he came to realize about its use in his own development.

I read a blog by Brandon Savage a couple of weeks ago and it triggered some thoughts. He refers to a blog by Marco Pivetta which basically states "Final all the things!". Brandon comes back with a more mild opinion where he offers the notion that this approach might be overkill. Since both posts got me thinking I tried to organise my thoughts on this in the following post.

Freek talks about a pretty common trend in the PHP world: the very rare use of "final". He suggests that "extension" of classes is a bad idea (or at least should be used a lot less) and how he has seen it commonly misused. He then shares two reasons why he thinks "final" is a good idea, mostly centering around how easy it is and how the Open/Closed principle applies. In the end, he notes that he'll be trying to use more "final" in the future and see where it takes him and his code.

tagged: final private reaction development practice class oop openclosed

Link: http://www.freeklijten.nl/2016/06/17/Final-private-a-reaction

DotDev.co:
Test Driven API Development using Laravel, Dingo and JWT with Documentation
Jun 20, 2016 @ 10:15:04

On the DotDev.co site a tutorial has been posted showing the full set up of an API using Laravel, Dingo and JWT tokens while following test-driven development principles along the way.

As the complexity of API’s increase, improving the ways we create them becomes a necessity. Let’s take a journey exploring an efficient way of building well-tested API’s that are easy to develop and maintain by wiring up several different open-source packages.

In this tutorial, we will build a very simple API for fruits that lists all the fruits, shows one fruit, creates a fruit, and finally deletes a fruit. The API will allow anyone to list and show fruits but we will use JWT Authentication to protect creating and deleting operations so only the registered users can use them.

The tutorial starts by helping you get the TDD environment set up for the application and the required libraries installed. From there they install and configure Dingo and look at the role that transformers play in the API output. With a basic API in place the JWT tokens are integrated and another package is used to generate simple, clean API documentation. Full links to other packages, screenshots of the expected output and all the code you'll need is included.

tagged: testdriven development tdd laravel api dingo jwt token tutorial

Link: https://dotdev.co/test-driven-api-development-using-laravel-dingo-and-jwt-with-documentation-ae4014260148#.tccatytip

PHP.net:
PHP 7.1.0 Alpha 1 Released
Jun 14, 2016 @ 10:48:09

The official PHP.net site has officially posted about the latest (alpha) release in the PHP 7.x series: PHP 7.1.0 Alpha 1:

The PHP development team announces the immediate availability of PHP 7.1.0 Alpha 1. This release marks the beginning of the first minor release in the PHP 7.x series. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

This is an alpha release and is not meant to be used in production. Features in this release include nullable types, allow specifying keys in list() usage and class constant visibility modifiers. You can see the full list of changes (and bugs fixed) in the NEWS file. As with all non-stable releases, you can get this latest alpha from this downloads page (for source) or the windows QA site (for the Windows binaries).

tagged: php71 alpha release version language preview development

Link: http://php.net/index.php#id2016-06-09-1

Intracto Blog:
How to save a kitten by writing clean code
Jun 03, 2016 @ 12:52:50

On the Intracto blog there's a new post from Joeri Timmermans talking about writing clean code with some good suggestions you can easily incorporate into your current processes.

So you came here to save a kitten? That's wonderful, but the real reason we're both here is to talk about clean code. In this blog post I'll be sharing some of my personal experiences and tips. But before we dive into the tips and tricks part, let's talk about what we, as developers, do and why we do it.

He touches on several topics including:

  • Best vs Fastest
  • Reading vs Writing
  • File and Folder Organization
  • Naming [conventions and clarity]

He also makes the recommendation to "return often", keep things DRY and makes a few recommendations of PHP-specific tools that can help.

tagged: clean code recommendation process development opinion

Link: http://blog.intracto.com/how-to-save-a-kitten-by-writing-clean-code

Laravel News:
A look at what’s coming to Laravel 5.3
Jun 02, 2016 @ 11:48:55

On the Laravel News site there's a post detailing out some of the new things coming to Laravel 5.3 currently still in development but should be released in the near future.

Laravel 5.3 is currently in development and with all new Laravel releases, new features are being teased out as they are added. Here is a quick look at some of these new features.

The list of these new features includes:

  • Eloquent Collections are cleanly serialized and re-pulled by queued jobs
  • Queue console output changed to show the actual class names
  • First Or Create [now takes additional values]
  • Multiple Migration Paths

There's also a mention of the Laravel Echo functionality that makes in-app broadcasting simpler. For some of the topics there's links to other posts with more information too.

tagged: laravel v53 development features list

Link: https://laravel-news.com/2016/06/look-whats-coming-laravel-5-3/

SitePoint PHP Blog:
Building a SparkPost Client: TDD with PhpUnit and Mockery
May 04, 2016 @ 12:26:32

On the SitePoint PHP blog they've continued their series covering the SparkPost mail delivery service and integrating it in to your application. In this latest part of the series author Christopher Pitt starts looking at the SparkPost API and uses it as a chance to practice some TDD (Test Driven Development) skills.

In a previous post, we looked at SparkPost (as an alternative to Mandrill), and explored a bit of the official PHP client. The official client handles a decent amount of work, but I got to thinking about what it would take to build a new client.

The more I thought about it, the more it made sense. I could learn about the SparkPost API, and practice Test Driven Development at the same time. So, in this post we’ll look to do just that!

He uses a few different libraries to explore the API and its endpoints: Guzzle for the HTTP requests and the Mockery+PHPUnit combination for the testing. He includes the setup and configuration for the testing environment and some sample tests for making sure things are connected. He then integrates Mockery into the testing, using it to mock the Guzzle requests and still have the tests pass even without the actual connection. He then works through several other tests and finishes the post with a mention of building coverage results for the "Client" class.

tagged: sparkpost client tutorial series tdd testdriven development mockery phpunit guzzle api

Link: http://www.sitepoint.com/building-a-sparkpost-client-tdd-with-phpunit-and-mockery/