Making the Best of PHPUnit Data Providers
When writing unit or integration tests for PHP, occasionally you need to test a specific scenario multiple times, with different input data. To make this easy and less repetitive, PHPUnit provides what is called Data Providers. A data provider is a method in some test case file, providing several sets of input data for one […]
Mapping Data and Behavior
Oftentimes, when writing software, we need to realize processes like this: “If A, then do B, otherwise do C.”, or that: “If A, then set X to B, otherwise set X to C.”. And there are also the more complex ones: “If A is equal to B, do X. If A is equal to C, […]
Inclusive Writing
Quite often, when I read through posts on various external but also company-internal blogs that I subscribed to, I stumble over this or that abbreviation or acronym, or sometimes a word that I simply don’t get in the current context. “The best thing to do here is to use a HOC.” — House of Cards? […]
How WordPress 5.3 Might Break Your Editor Screen
This post comes in three parts. In the first, I present the problem I was facing when upgrading a site that was running on WordPress 5.2.x and no Gutenberg plugin. The second part is about the solution I found, which I think is no more than a workaround fix, actually. In the third part, I […]
Making the Best of Config
Over the last half year, I have been looking into several of project repositories on GitHub, and I came across quite a few different ways of configuring (and using) various tools and services. In this post, I would like to share some simple, yet effective suggestions that, in my opinion, make for a much easier […]
ABC – The Look of Love (in Code)
No, sorry, this is not about the song. But well, while you’re all here, why not start it in the background, and continue reading…? 😅 CONFLICT (some-branch): Merge conflict in some/file.here Over and over again, I encountered merge conflicts due to several people adding stuff to some kind of list by simply appending whatever they […]
How to Set up Modern PHP Coding Standards for WordPress
This post explains how to write WordPress code following modern PHP best practices, adhering to the official (or other established) coding standards.
Three Things You Should Know About WordPress Filters
Oftentimes, people are using WordPress filters in a wrong way. This post tries to educate people on how to correctly filter data.
Event Listeners and Business Logic
In this post, I want to share a simple, yet effective best practice when it comes to (JavaScript) event listeners, and code reuse.
On PHP Language Constructs and Parentheses
What are PHP language constructs, why do they exist, and what are they good for? And what’s the issue with parentheses? Well, here are some answers to that.