Posts

Stop (ab)using allow failure

We’ve all had our CI fail due to an issue that couldn’t be fixed right away. Usually something like a security issue in a downstream package that can’t be updated yet.

Jul 24, 2022

Creating better services

When writing code, you generally want to split up the logic in to different classes. You have your controller classes which take a request, and return a response. You write value objects to represent information which is important to your application.

Nov 13, 2021

Differential serving with webpack encore

Recently we’ve been looking into differential serving. With our set up there were a few complications, so in this post i’ll share how we overcame those, and how to set up differential serving with webpack encore.

Jun 19, 2021

PHP needs an "unknown" type

If you are familiar with Typescript, you may know their any type. With any you can do anything. It signals that you don’t know about the actual type, and that anything goes.

May 21, 2021

Using CSS modules in react when testing with enzyme

Use CSS modules classes as selectors for your tests, and have better snapshots.

Apr 24, 2021

Testing Exceptions in PHPUnit

Last week i gave 10 phpunit tips. This week we’ll take a look at testing exceptions, which wasn’t covered in that post. Lets start with some example code that we will be testing.

Apr 9, 2021

10 PHPUnit Tips

PHPUnit is the defacto testing framework for PHP. In this post i want to share with you my top 10 tips for PHPUnit. I’m using PHPUnit 9.5, but most of these apply to older versions as well.

Apr 2, 2021

Help my Doctrine migrations are broken!

Recently we ran into a problem with doctrine migrations. The schema was manually edited, and wrong migrations were committed to the repository. For a dev (and even staging) env you could just drop the database, fix the migrations, and run them again.

Mar 25, 2021

A problem with Twig

I’m a fan of twig, and wouldn’t consider moving back to plain php. But, it does come with a few problems. In this post we’ll explore one of the problems i have with twig, and how to work around it.

Mar 18, 2021

Explore Your Types

Don’t worry, this isn’t a ‘what type of sandwich are you?’ kinda post. Instead we’ll look at how we can safely add types to our legacy code. Adding types There are really two ways of adding types.

Mar 11, 2021