If you develop code on both Windows and Linux machines you might have run into inconsistent line endings. This might lead to "empty" commits, consisting only of changed line ednings. This post describes how a .gitattributes file can solve all your (line ending-related) problems.
The SOLID design principles are guidelines for building software that is easier to understand and maintain while also being more flexible. These 8 resources explain what SOLID is, and what it isn't.
PHP 7+ has support for strict type checking. Using PHP Code Sniffer we can enforce the use of
declare(strict_types=1); at the beginning of each file.
On June 7, 8, and 9, the Dutch PHP Conference 2018 was held. Now that all information has settled down, and most talks are available on YouTube, I want to share the talks I liked the most.
It is best to prevent the usage of "unsafe-inline" in your Content Security Policy (CSP) header. In this article, I will explain why that is the case and how to transform unsafe assets into safe ones.
Filtering Laravel Collections can become a performance bottleneck. Using the
filter method is significantly faster then the
where method, if used properly. Read the article for a full comparison and benchmark results.
Code coverage results can give a false sense of quality. With the
@coversNothing annotations, you can better express the intention of your test. This leads to better code coverage results that truly reflect the coverage of your tests.
This article explains how you can require a package from a local path into your project with Composer. This way you can run a local copy of a repository and test any changes you make. Because the local repo will be symlinked changes are shared in real-time, there is no need for intermediate committing and updating.
When you start a new project it is best to stick the best practices. Skeleton projects provide a good basis. I'll describe how to get up and running fast.
This is a quick tip on how to get code coverage results when running PHPUnit on Laravel Homestead. This will enable Xdebug first and then run your tests.