Sound of Symfony Podcast: Episode 12 – Building a stronger community

The Sound of Symfony podcast, with hosts Magnus Nordlander and Tobias Nyholm, has posted their latest episode: Episode #12 – [Building a stronger community](Episode 12 – Building a stronger community).

This time we’re talking about the Symfony Community, how we can make it better, and what we can learn from other communities.

Other topics mentioned in this episode include:

You can listen to this latest episode either through the in-page audio player or by downloading the show directly. If you enjoy the show, be sure to subscribe to their feed to get the latest shows as they’re released.

PHPDeveloper.org

Thijs Feryn: Derick Rethans – MongoDB, Xdebug & PHP

Thjis Feryn has posted another in his series of video interviews with members of the PHP community during his travels. In this new episode he talks with Derick Rethans of Xdebug and MongoDb.

Derick Rethans is my guest for this episode. The interview was recorded at PHPBenelux Conference 2016 in the community village.

[…] Derick is a well-known and well-respected member of the PHP community. He is primarily known as the author and maintainer of Xdebug, a debugging extension for PHP. He also developed the DateTime extension. He even wrote a book about it. Derick works for MongoDB where he works on the MongoDB extension and the separate library.

You can catch this episode either via the video (in-page or on YouTube) or for the more audio-inclined over on SoundCloud. Be sure to check out his other interviews while you’re at the site as well.

PHPDeveloper.org

PHP Town Hall Podcast: Episode 48: Code of Conduct

The PHP Town Hall podcast, hosted by PHP community members Phil Sturgeon and Ben Edmunds, has posted their latest episode – a discussion with Jenny Wong about Codes of Conduct and more specifically the effort to try to adopt one for PHP.

Whilst all three of us think a Code of Conduct is a good idea, we talk through some of the various for and against reasoning that people have, and try to outline the logical failures behind some of the FUD being spread around during this discussion.

We cover a few things, from the intent of a Code of Conduct, explain it’s reach is not as scary as many seem to think, outline a few things that a Code of Conduct does not try to do, and talk about some of the problems minorities have at conferences and online which could be simplified over time with a useful CoC.

The goal behind the show is to try and help "open some minds" and bring a constructive approach to discussing the Code of Conduct without the usual (and unfortunate) reactions we’ve already seen from the community. You can listen to this latest podcast through the in-page video player or directly on YouTube. If you enjoy the show and want to check out past and future shows you can subscribe to their RSS feeds.

PHPDeveloper.org

SitePoint PHP Blog: How to Build Your Own Dependency Injection Container

The SitePoint PHP blog has posted a tutorial showing you how to build something that’s become an integral part of most frameworks and applications practicing modern PHP development: a dependency injection container.

A search for “dependency injection container” on packagist currently provides over 95 pages of results. It is safe to say that this particular “wheel” has been invented.

However, no chef ever learned to cook using only ready meals. Likewise, no developer ever learned programming using only “ready code”. In this article, we are going to learn how to make a simple dependency injection container package.

He walks you through the entire process of creating the container and each of the pieces that make it up:

  • the overall interface for the container (with has/get methods)
  • having it cooperate with the "container interoperability" structure
  • reference handling
  • constructor injection functionality

Code is included the whole way showing you how to create the parts and fit them together to make more of a whole. He ends the post with a look at a few other dependency injection containers and a reference to the repository with the end result of the article.

PHPDeveloper.org

Laravel News: Laravel: Up and Running Available for Preorder

If you’re interested in the Laravel framework and possibly using it for your upcoming projects but aren’t sure where to start, you should consider checking out Matt Stauffer’s upcoming O’Reilly book "Laravel: Up and Running". According to this post on the Laravel News site the book is now available for pre-order.

Matt Stauffer has been writing a new book on Laravel named Laravel: Up and Running: A Framework for Building Modern PHP Apps and it’s published by O’Reilly Media. […] This first edition is 250 pages and will come in either paperback or ebook form, but this current preorder is only available in paperback. Based on Amazon the expected shipping date is August 25, 2016.

The book walks you through the creation of a Laravel application from start to finish. it’s no meant as a reference but a "work book" to teach the foundations of the framework. It hopes to provide a single point where developers, especially those familiar with "C-family programming languages", will be able to get started quickly.

PHPDeveloper.org

ThePHP.cc: Questioning PHPUnit Best Practices

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).

PHPDeveloper.org

TutsPlus.com: Test-Driven Development With Laravel & Doctrine

On the TutsPlus.com site they’ve posted a new tutorial showing you how to do test-driven development with Laravel and Doctrine, making use of Doctrine’s own testing functionality inside of a Laravel application for PHPUnit based unit testing.

As a PHP developer, you may use the Test-Driven Development (TDD) technique to develop your software by writing tests. Typically, TDD will divide each task of the development into individual units. A test is then written to ensure that the unit behaves as expected. […] TDD verifies that the code does what you expect it to do. If something goes wrong, there are only a few lines of code to recheck. Mistakes are easy to find and fix. In TDD, the test focuses on the behavior, not the implementation. TDD provides proven code that has been tested, designed, and coded.

[…] PHPUnit is the de-facto standard for unit testing PHP. It’s essentially a framework for writing tests and providing the tools that you will need to run tests and analyze the results. PHPUnit derives its structure and functionality from Kent Beck’s SUnit.

He briefly talks about some of the assertions that PHPUnit has to offer before getting into the support that Laravel includes and how to configure it so Doctrine can work with your database. He then talks about Doctrine, briefly introducing the popular database abstraction tool and how to integrate it with a Laravel application. From there he starts in on the tests themselves, showing code that uses fixture data to create several tests for Post and Comment data.

PHPDeveloper.org