Autoloading Laravel application code with PSR-4

Posted 2014-01-09
Category PHP
When you use Laravel it's very likely you autoload extra code than just the controllers/models that are autoloaded by default. Some use classmap, others use PSR-0. Well, now you can use PSR-4 too.

Read More »

Composer now supports PSR-4

Posted 2014-01-03
Category PHP
I haven't really posted about PSR-4 here, but if you follow me on Twitter or hang out on Reddit you've probably seen some news about it. PSR-4 was voted in as an "accepted" PSR by the FIG in December. It took a little while to get done and went through a series of painful rewrites but when we have in the end is a document that reflects what this truly is: an improvement on PSR-0. Time to upgrade your packages, but don't release them just yet.

Read More »

The Tribal Framework Mindset

The PHP community has made some amazing leaps forward in the last few years, but some folks still (intentionally, or unintentionally) are contributing towards the siloing of the PHP community into framework-specific sub-sections. We used to work that was for a handful of reasons, but with Composer, the FIG and the onset of PSR's we have literally no reason to do this anymore. This article hopes to point out some of the ways in which that can happen, with potential solutions too.

Read More »

PHP API's: Fractal of GOOD Design

Posted 2013-12-12
Category PHP
Recently I started a new blog series called "Build API's That You Wont Hate". It was meant to be a fleshed out series based off of my experiences over the last several years building nontrivial RESTful API's for all sorts of clients. I didn't fully plan the series and just kinda got going with it, and after thinking about things a little more I realised that it was going to be a huge commitment. I figured I should turn it into an ebook, and it's coming along pretty well. 

Read More »

Benchmarking Codswallop: NodeJS v PHP

Posted 2013-11-12
Category PHP
Sometimes people link me to articles and ask for my opinions. This one was a real doozy.

Read More »

Build API's That You Wont Hate: Part 1 - Useful Database Seeding

Posted 2013-11-08
Category PHP
A little while back I produced an article called Building a Decent API which was mostly a tongue-in-cheek list of things that I'd come across in other APIs that pissed me off, or that I had done myself and used my super-power of hindsight combined with sarcasm to make a set of rules for you to live by when building APIs. Now I'll write more in-depth on various aspects of API development that you need to know if you're going to build something that isn't a total mess.

Read More »

PSR-2 v CodeSniffer PSR-2: A Success Story

Posted 2013-10-15
Category PHP
I've had static analysis tools running in Sublime Text for a long time, but for most of that time I have had CodeSniffer and it's PSR-2 rules disabled. I couldn't for the life of me remember why I had done that, until I turned it back on again. All of a sudden it started complaining about code that I had always considered to be perfectly compliant.

Read More »

Solving the PHP Internals Workflow

Posted 2013-09-12
Category PHP
PHP internals has been a cold, harsh, unwelcome land for a long time, and it's coming to a head recently with mutliple vocal developers highlighting issues. While some are trying to resolve the actual medium through which conversations happens, I'm looking into ways we can try to fix the workflow so the actual conversation being had can be the most constructive it can possibly be. 

Read More »

T_PAAMAYIM_NEKUDOTAYIM v Sanity

Posted 2013-09-09
Category PHP
As somebody who has followed internals (and been hearing tales of woe from others) for a while, I've seen so many conversations with truly bizarre, irrelevant and trolly responses coming back from everyone all the way up to Rasmus himself. It was this sort of trolling and bullshit that lead to Anthony Ferrera's recent (and completely understandable) departure from the core. This walks through one example of trollolololing, as an exercise in eduction for anyone unaware of the madness that internals can host.

Read More »

Named Parameters in PHP

Posted 2013-09-01
Category PHP
Converting a Python Twitter API package to PHP turned out to be more trouble than I initially expected due to the usage of Python's named parameters. This artice uses the Twitter library as an example for why named parameters are important and useful.

Read More »