Visualizing PHPUnit Tests

In an article on the Hackster.io site explains in detail how he made a nice visualization of unit test results. Pretty cool what you can do with a raspberry pi, some LEDS and a couple of scripts. I wanted to create a desktop gadget to visualize the progress of unit tests run via PHPUnit.I’ve named […]

Continue reading →

Understanding Laravel’s HighOrder Collections

One of my favourite features that was introduced in Laravel 5.4 are the higher order collection functions. It allows you to rewrite collect($models)->filter(function(Model $model) { $model->passesFilter(); }); to: collect($models)->filter->passesFilter(); This works with the filter method an a bunch of other collection methods. In a new post on his blog Nicola Malizia explains how these methods […]

Continue reading →

Closure Binding as an alternative to “use” variables

On his blog Mark Baker shares some thoughts on how to use closure binding to avoid having import variables with the use keyword. You’ll learn how to rewrite $filteredArrayData = array_filter( $arrayData, function($value) use ($minimumPrice, $maximumPrice) { return $value->price >= $minimumPrice && $value->price < $maximumPrice; } ); to $filteredArrayData = array_filter( $bookData, $priceFilter->inRange(5.00, 15.00) ); […]

Continue reading →

A Laravel package to impersonate users

A great feature of Laravel Spark is it’s ability to impersonate other users. As an admin you can view all screens as if you are logged in as another user. This allows you to easily spot a problem that your user might be reporting. Laravel-impersonate is a package, made by MarceauKa and Thibault Chazottes that […]

Continue reading →

Add syntactic sugar by preprocessing PHP

In an awesome article at Sitepoint Christopher Pitt explains how he used the yay macro library to build up plugin framework to add new language features to PHP. Chris made plugins that allows this syntax in PHP. // short closure syntax $items = [“one”, “two”, “three”]; $ignore = “two”; array_filter($items, ($item) => { return $item […]

Continue reading →

Configuration-driven PHP security advice considered harmful

Scott Arciszewski debunks the commonly given advice on securing your PHP installation by setting some php.ini values. There have been countless examples posted in various places (Reddit, Hacker News, Twitter, Facebook, Slashdot, and even LinkedIn group discussions), and while a handful occasionally contain one or two tips that might be beneficial towards securing your PHP […]

Continue reading →