Silex Routing vs Trailing Slashes

In Silex-based projects I always define my routes with a trailing /. When defining a route with a trailing slash, the router will respond to both the route without and with slash: $app->get(‘/hello’, …); will respond to http://localhost/hello but not to http://localhost/hello/ $app->get(‘/hello/’, …); will respond to http://localhost/hello and to http://localhost/hello/ Unfortunately this only works […]

Automatically rerun PHPUnit tests when source code changes with phpunit-watcher

Nice new package by Freek from Think of it like Jest, but for PHP: Wouldn’t it be great if your PHPUnit tests would be automatically rerun whenever you change some code? This package can do exactly that. By default it will watch all files in the src, app and tests subdirectories in the directory […]

Zttp, a developer friendly wrapper for Guzzle

If you’re not familiar with the evolution of Guzzle, the library has basically gotten more professional and less usable with each new version. New layers upon layers of specification-respecting abstractions and rules made Guzzle incredibly difficult to get started with. Zttp solves just that, by keeping things simple: Zttp is a simple Guzzle wrapper designed […]

Snapshot testing with PHPUnit

use Spatie\Snapshots\MatchesSnapshots; class OrderTest { use MatchesSnapshot; class test_it_casts_to_json() { $orderId = new Order(1); $this->assertMatchesJsonSnapshot($order->toJson()); } } Again great work by the folks at Spatie: The difference between a classic assertEquals and an assertMatchesSnapshot is that you don’t write the expectation yourself when snapshot testing. When a snapshot assertion happens for the first time, it […]

Easily manipulate images in PHP with spatie/image

Great new package by the folks at Spatie to working with images in PHP, powered by Glide. Glide itself is great, but uses an URL based approach (which has its benefits); yet in most cases I find myself using a code based approach. This is where spatie/image comes into play: spatie/image wraps up Glide so […]

Private Packagist

Mid-December Nils Adermann – Co-Founder of Packagist Conductors & Creator of Composer for PHP – announced Private Packagist. Being a hosted service, setting up your own Composer package repository on Private Packagist is done with a few clicks. No matter if your private source code is hosted on GitHub, GitLab, Bitbucket, any of their on-premise […]

Facebook Live Reactions

Facebook Live Reactions is a Linux script for creating Facebook Live Streams that contains interactive reaction counts. It also includes an interactive shoutout feature that gives live shoutouts to users who typed “shared” into the comment box. The livestreaming itself is handled through ffmpeg; whilst PHP takes care of the counting of all reactions and […]