All About PSR-7 Middleware

On May 10th, 2016, I proposed an HTTP Middleware PSR to PHP FIG. Since then, there has been a significant amount of concern around one aspect of the proposal in particular, which Anthony Ferrara has summarized quite well in his blog post All About Middleware. Before we get too deep…

Standard Code Formatting with EditorConfig

EditorConfig is a very simple configuration file that can be used in any code base to define formatting expectations like spaces or tabs, size of tab, file ending newlines, etc. Installation First you will need the editorconfig binary. On a Mac with Homebrew, this is as simple as: brew install…

Better Commits with Static Review

One of the best changes that I have recently ever made to my workflow has been reading Chris Beams' excellent How to Write a Git Commit Message. If you haven't read it, you should go do it right now and come back once you are done. The Problem You're programming…

The Binary Classification of Objects

After working on immutable data structures and dependency injection with Auryn I often find myself questioning class constructor style when doing code reviews. Recently I was reviewing a pull request that had this signature in it: public function __construct( RequestInterface $request, DateTime $now, $key, $ttl, $algorithm = 'HS256' ) { ... } A Funny Smell…