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

ThePHP.cc:
Questioning PHPUnit Best Practices
Feb 05, 2016 @ 12:13:04

In this new post to thePHP.cc blog Sebastian Bergmann (creator of the PHPUnit unit testing tool) questions of some the current "best practices" involved in using the tool. More specifically he looks at the handling for expected exceptions and proposes a new practice to use going forward.

It is important to keep in mind that best practices for a tool such as PHPUnit are not set in stone. They rather evolve over time and have to be adapted to changes in PHP, for instance. Recently I was involved in a discussion that questioned the current best practice for testing exceptions. That discussion resulted in changes in PHPUnit 5.2 that I would like to explain in this article.

He talks about the currently widely used practice of the @expectedException annotation to define when an exception should be thrown from the code inside the unit test. Sebastian talks about the evolution of this into other annotations around the code and message returned from the exception too. He then proposes the new best practice as a result of some discussion around the annotation method: returning to the use of the setExpectedException method. He provides some reasoning behind the switch including the timing of the exception being thrown (not just "any time" but a more specific time).

tagged: phpunit bestpractice expected exception annotation method expectedexception

Link: https://thephp.cc/news/2016/02/questioning-phpunit-best-practices

Rob Allen:
PSR-7 file uploads in Slim 3
Feb 05, 2016 @ 11:08:23

In a post to his site Rob Allen explains how to handle file uploads in a PSR-7 structure, specifically illustrating with an example using the Slim (v3) framework.

Handling file uploads in Slim 3 is reasonably easy as it uses the PSR-7 Request object, so let's take a look.

He shows how to create a simple index route in a Slim application and render a view containing just a simple form with an upload field and submit button. When the form submits, he uses the getUploadedFiles method on the Slim Request object to get the file information for the upload. He also shows how to check for errors on the upload using the file data as an object and calling the getError method.

tagged: slim3 file upload tutorial handling error psr7 request

Link: https://akrabat.com/psr-7-file-uploads-in-slim-3/

Community News:
LaraChat Live, Episode #1
Feb 05, 2016 @ 10:27:11

A new Laravel-centric podcast has started up and has posted its first episode: LaraChat Live. Their first recording if from a Google Hangout of a roundtable with host Shawn Mayzes and several other community members from the LaraChat Slack channel

Larachat Live is a live round table discussion from the Larachat community. We discuss PHP and Laravel as well as various other industry related topics.

This weeks discussion (our first round table) will include introductions from community members and our meet & greet outside of Larachat.co. This weekly round table will also include our discussion on PHPMD and PHPCS.

You can watch this episode either using the in-page video player or directly on YouTube. If you enjoy the show and want to keep up with future episodes, subscribe to their YouTube channel and you'll be notified as new videos are published (and when new shows are coming up).

tagged: video podcast roundtable larachat slack channel ep1

Link: https://www.youtube.com/watch?v=rACXJLMReK0

PHP.net:
PHP 5.6.18 & 5.5.32 Released
Feb 05, 2016 @ 09:49:31

On the main PHP.net site they've officially announced the release of the latest versions in the 5.6.x and 5.5.x series: PHP 5.6.18 and PHP 5.5.32.

The PHP development team announces the immediate availability of PHP [5.5.32 and 5.6.18]. This is a security release. Several security bugs were fixed in this release. All PHP [5.5 and 5.6] users are encouraged to upgrade to this version.

As always you can download this latest release from either the main downloads page or from windows.php.net for the Windows binaries. If you'd like to see exactly what was fixed in these releases, check out the full Changelog.

tagged: language version security bugfix upgrade

Link: http://php.net/archive/2016.php#id2016-02-04-3


Community News:
phpschool.io Announced
Feb 04, 2016 @ 12:45:55

A new service has launched in an effort to help teach PHP to those looking to learn in a different sort of way. The phpschool.io site provides you with a series of exercises that walk you through both the fundamentals of the language and a few more complex topics.

PHP School is a set of ever expanding workshops to teach you basic to advanced concepts in PHP. We launch with one workshop: Learn You PHP. [...] Each exercise increases in difficulty, guiding you through the core concepts of PHP.

Currently the tutorials cover topics like "My First IO", separation of concerns, working with exceptions and handling dependencies. The installation of the lessons is as simple as making a composer require call and installing the packages and dependencies required by the tool. They're also actively looking for community contributions to add more workshops to the based on the Learn You PHP package currently included. The training was inspired by what NodeSchool provides for the Node.js language.

tagged: phpschool learning training beginner language tutorial

Link: http://www.phpschool.io/

SitePoint PHP Blog:
9 Development Workflow Upgrades You Should Know About
Feb 04, 2016 @ 11:39:10

On the SitePoint PHP blog editor Bruno Skvorc shares 9 development workflow upgrades that can help to make you a more efficient (and informed) developer. This is a list of handy tools and changes you can make to current software to help make you more productive.

Every once in a while I run into a tool or plugin so useful I can’t not add it to my arsenal. I usually shout out tweets and try to spread the word that way, but this time I believe I’ve got such a neat (and somewhat random) collection of productivity boosting entries, they deserve a collective article.

Included in his list of helpful tools and tips are things like:

  • git-fresh
  • [Composer changelogs](Composer changelogs)
  • Changing PhpStorm's configuration for faster rendering
  • Parallel downloads [with Composer](Composer parallel downloads)

There's also something he's called the "comfort collection" that can help you and your body feel less of the pains usually associated with long hours in front of the keyboard.

tagged: workflow upgrades development tools configuration tips comfort

Link: http://www.sitepoint.com/9-development-workflow-upgrades-you-should-know-about/

Laravel News:
New Speakers Announced for Laracon.us
Feb 04, 2016 @ 10:03:42

The Laravel News site has posted an announcement about some of the latest additions to the Laracon.us schedule for this year's event.

Laracon.us scheduled for July 27-29, in Louisville Kentucky has announced nine speakers for the event.

These speakers include Taylor Otwell (creator of Laravel), Zeev Suraski of Zend, Adam Wathan from Tighten Co. and Amanda Folson, developer evangelist at PagerDuty. If you're interested in joining this group and would like to submit your own ideas for sessions, the call for submissions is still open for now. If you're just interested in the conference and want more information (or to get tickets) you can check out the main conference site.

tagged: laracon15 laraconus speaker announcement louisville kentucky

Link: https://laravel-news.com/2016/02/new-speakers-announced-for-laracon-us/

Sound of Symfony Podcast:
Episode 11 - Looking forward to Symfony 4
Feb 04, 2016 @ 09:46:01

The Sound of Symfony podcast has come back and posted their latest episode with hosts Magnus Nordlander and Tobias Nyholm. In this latest episode (#11) they talk about Symfony 4 and look forward to some of the things they'd like to see in this future release.

Having recovered from SymfonyCon and had happy holidays, Sound of Symfony is back on the ether(net). This week we talk about what we'd like to see in upcoming versions of PHP and Symfony.

Other topics mentioned include:

  • Various Drupal initiatives
  • Sub-requests (a request to render just a partial page, not the whole thing through the HttpKernel)
  • Object-oriented CSS

You can listen to this latest episode either through the in-page audio player or by downloading the audio directly. If you enjoy the episode be sure to subscribe on iTunes to get the latest episodes as they're released.

tagged: soundofsymfony podcast ep11 symfony4 drupal subrequest, oop, css

Link: http://www.soundofsymfony.com/episode/episode-11/