Blog archive
February 2024
November 2022
October 2022
September 2022
Good design means it's easy-to-change
Categories: PHP Tags: design refactoring legacy code
Can we consider DateTimeImmutable a primitive type?
Categories: PHP Tags: types object design value objects
Is it a DTO or a Value Object?
Categories: PHP Tags: DTO Value objects
A step-debugger for the PHP AST
Categories: PHP Tags: PHPStan Rector Abstract Syntax Tree
August 2022
Simple Solutions 1 - Active Record versus Data Mapper
Categories: PHP Tags: active record data mapper object design simplicity
What's a simple solution?
Categories: PHP Tags: design simplicity
July 2022
My book-writing workflow
Categories: PHP Tags: writing books
When to use a trait?
Categories: PHP Tags: object design traits
Decoupling your security user from your user model
Categories: PHP Tags: decoupling hexagonal architecture CQRS Symfony user provider
Effective immutability with PHPStan
Categories: PHP Tags: immutability OOP PHPStan
June 2022
April 2022
March 2022
February 2022
January 2022
November 2021
October 2021
September 2021
Quick Testing Tips: One Class, One Test?
Categories: PHP Tags: testing
Quick Testing Tips: Write Unit Tests Like Scenarios
Categories: PHP Tags: testing BDD
Where do types come from?
Categories: PHP Tags: types OOP mapping
Quick Testing Tips: Testing Anything; Better Than Testing Nothing?
Categories: PHP Tags: testing
Quick Testing Tips: Self-Contained Tests
Categories: PHP Tags: testing fixtures
August 2021
June 2021
May 2021
Don't test constructors
Categories: PHP Tags: testing object-oriented programming Domain-Driven Design
Early release of Rector - The power of automated refactoring
Categories: PHP Tags: refactoring legacy code book Rector
March 2021
Do tests need static analysis level max?
Categories: PHP Tags: static analysis testing
Book excerpt - Decoupling from infrastructure, Conclusion
Categories: PHP Tags: hexagonal architecture object-oriented programming decoupling
Testing your controllers when you have a decoupled core
Categories: PHP Tags: testing hexagonal architecture controller
February 2021
Does it belong in the application or domain layer?
Categories: PHP Tags: architecture layers
Excerpt from PHP for the Web: Error handling
Categories: PHP Tags: error handling exceptions
Talk review: Thomas Pierrain at DDD Africa
Categories: PHP Tags: hexagonal architecture decoupling testing
Successful refactoring projects - The Mikado Method
Categories: PHP Tags: legacy legacy code refactoring
Successful refactoring projects - Set the right goal
Categories: PHP Tags: legacy legacy code refactoring
Successful refactoring projects - Prepare to stop at any time
Categories: PHP Tags: legacy legacy code refactoring
Should we use a framework?
Categories: PHP Tags: architecture framework decoupling
September 2020
Dynamically changing the log level in Symfony apps
Categories: PHP Tags: logging Symfony Monolog
A simple recipe for framework decoupling
Categories: PHP Tags: framework decoupling
Violating the Dependency rule
Categories: PHP Tags: design object-oriented programming
July 2020
Relying on the database to validate your data
Categories: PHP Tags: design database Domain-Driven Design
Free book chapter: Key design patterns
Categories: PHP Tags: design patterns
Release of the Advanced Web Application Architecture book
Categories: PHP Tags: book release architecture hexagonal architecture
June 2020
Unit test naming conventions
Categories: PHP Tags: testing
Book release: PHP for the Web
Categories: PHP Tags: book release
May 2020
April 2020
Creating a simple link registry
Categories: PHP
Early release of the Advanced Web Application Architecture book
Categories: PHP Tags: book release architecture
March 2020
Functional tests, and speeding up the schema creation
Categories: PHP Tags: testing functional testing fixtures Symfony
Book review: The Writer's Process, by Anne Janzer
Categories: PHP Tags: writing book review
February 2020
January 2020
December 2019
The release of Object Design Style Guide
Categories: PHP Tags: Object Design Style Guide release
Defining a custom filter and sorter for Sculpin content types
Categories: PHP Tags: Sculpin
November 2019
Improvements in personal website deployment
Categories: PHP Tags: Docker Digital Ocean Traefik
Introducing MailComments
Categories: PHP Tags: MailComments
September 2019
Is not writing tests unprofessional?
Categories: PHP Tags: testing community
Using phploc for a quick code quality estimation - Part 2
Categories: PHP Tags: quality assurance object design
Using phploc for a quick code quality estimation - Part 1
Categories: PHP Tags: quality assurance object design
July 2019
Dividing responsibilities - Part 2
Categories: PHP Tags: object design CQRS
Dividing responsibilities - Part 1
Categories: PHP Tags: object design CQRS
June 2019
You may not need a query bus
Categories: PHP Tags: command bus query bus SimpleBus
Learning Laravel - Observations, part 1: The service container
Categories: PHP Tags: Laravel
May 2019
March 2019
Style Guide for Object Design: Release of the PHP edition
Categories: PHP Tags: object design Style Guide for Object Design release
Hand-written service containers
Categories: PHP Tags: dependency injection service container
February 2019
January 2019
December 2018
October 2018
September 2018
Test-driving repository classes - Part 1: Queries
Categories: PHP Tags: design fixtures testing database
Assertions and assertion libraries
Categories: PHP Tags: object design assertions
Final classes by default, why?
Categories: PHP Tags: design reuse package design interfaces
Reusing domain code
Categories: PHP Tags: Domain-Driven Design reuse package design
August 2018
When to add an interface to a class
Categories: PHP Tags: object design interfaces
Improving your software project by being intolerant
Categories: PHP Tags: book review
More code comments
Categories: PHP Tags: clean code design documentation
Negative architecture, and assumptions about code
Categories: PHP Tags: Domain-Driven Design OOP object design
July 2018
Objects should be constructed in one go
Categories: PHP Tags: Domain-Driven Design OOP object design
About fixtures
Categories: PHP Tags: fixtures database testing
Blogging every week
Categories: PHP Tags: writing
June 2018
Testing actual behavior
Categories: PHP Tags: testing aggregate design Domain-Driven Design
Doctrine ORM and DDD aggregates
Categories: PHP Tags: Domain-Driven Design value objects entity identity Doctrine ORM
Road to dependency injection
Categories: PHP Tags: dependency injection legacy legacy code code quality
Deliberate coding
Categories: PHP Tags: clean code deliberate coding documentation
May 2018
When and where to determine the ID of an entity
Categories: PHP Tags: Domain-Driven Design value objects entity identity
Book review: Fifty quick ideas to improve your tests - Part 2
Categories: PHP Tags: book review BDD testing
Book review: Fifty quick ideas to improve your tests - Part 1
Categories: PHP Tags: book review BDD testing
Book review: Discovery - Explore behaviour using examples
Categories: PHP Tags: book review BDD testing Behat
Remote working
Categories: PHP Tags: book review remote
April 2018
Context passing
Categories: PHP Tags: object design multi-tenancy
Combing legacy code string by string
Categories: PHP Tags: legacy code legacy code quality
Exceptions and talking back to the user
Categories: PHP Tags: exceptions validation Domain-Driven Design
Mocking the network
Categories: PHP Tags: testing mocking hexagonal architecture ACL Domain-Driven Design architecture
March 2018
Modelling quantities - an exercise in designing value objects
Categories: PHP Tags: Domain-Driven Design value objects object design
ORMless; a Memento-like pattern for object persistence
Categories: PHP Tags: persistence database
Defining multiple similar services with Docker Compose
Categories: Docker Tags: Docker Compose Docker
Mocking at architectural boundaries: the filesystem and randomness
Categories: PHP Tags: testing mocking hexagonal architecture architecture
February 2018
Lasagna code - too many layers?
Categories: PHP Tags: layers architecture
Mocking at architectural boundaries: persistence and time
Categories: PHP Tags: testing mocking hexagonal architecture architecture
Local and remote code coverage for Behat
Categories: PHP Tags: testing Behat code coverage
Call to conference organisers: pay your workshop instructors
Categories: Community Tags: community conference
Reducing call sites with dependency injection and context passing
Categories: PHP Tags: legacy legacy code code quality call sites object design
January 2018
Unary call sites and intention-revealing interfaces
Categories: PHP Tags: legacy legacy code code quality call sites object design
Keep an eye on the churn; finding legacy code monsters
Categories: PHP Tags: legacy legacy code churn code quality
Simple CQRS - reduce coupling, allow the model(s) to evolve
Categories: PHP Tags: CQRS legacy legacy code database object design
October 2017
August 2017
Preparing a Leanpub book for print-on-demand
Categories: Book Tags: Leanpub Markdown CreateSpace
Layers, ports & adapters - Part 3, Ports & Adapters
Categories: PHP Tags: architecture design hexagonal architecture
Layers, ports & adapters - Part 2, Layers
Categories: PHP Tags: architecture design hexagonal architecture
July 2017
Layers, ports & adapters - Part 1, Foreword
Categories: PHP Tags: architecture design hexagonal architecture
Designing a JSON serializer
Categories: PHP Tags: serializer
June 2017
How to make Sculpin skip certain sources
Categories: PHP Tags: Sculpin
Making a Docker image ready for use with Swarm Secrets
Categories: Docker Tags: Docker Swarm
May 2017
April 2017
March 2017
Making money with open source, etc.
Categories: PHP Symfony Tags: Symfony open source community
Microservices for everyone - The introduction
Categories: Book Tags: microservices Microservices for everyone
Bash practices - Part 2: CQS and return values
Categories: Bash Tags: Bash
Bash practices - Part 1: Input validation and local variables
Categories: Bash Tags: Bash
Adventures with Bash
Categories: Bash Tags: Bash
February 2017
Duck-typing in PHP
Categories: PHP Tags: duck-typing
Convincing developers to write tests
Categories: PHP Tags: testing unit testing functional testing
DDD Europe Conference Report - part III
Tags: Domain-Driven Design conference
DDD Europe Conference Report - part II
Tags: Domain-Driven Design conference
DDD Europe Conference Report - part I
Tags: Domain-Driven Design conference
January 2017
Introducing the ConvenientImmutability package
Categories: PHP Tags: functional programming immutability
Introducing the SymfonyConsoleForm package
Categories: PHP Symfony Tags: Symfony forms console
Containerizing a static website with Docker, part III
Categories: PHP Docker Tags: Sculpin Docker
Containerizing a static website with Docker, part II
Categories: PHP Docker Tags: Sculpin Docker
Containerizing a static website with Docker, part I
Categories: PHP Docker Tags: Sculpin Docker
December 2016
Creating virtual pages with Sculpin
Categories: PHP Tags: Sculpin documentation
Project documentation with Sculpin
Categories: PHP Tags: Sculpin documentation
May 2016
Symfony Catalunya
Categories: PHP Symfony2 Tags: Symfony Catalunya conference
A Year With Symfony - End Of Life
Categories: Book PHP Symfony2 Tags: A Year With Symfony
July 2015
Behind the scenes at Coolblue
Categories: PHP Tags: micro services event sourcing legacy legacy code
Meeting the Broadway team - talking DDD, CQRS and event sourcing
Categories: PHP Tags: Domain-Driven Design event sourcing CQRS
Refactoring the Cat API client - Part III
Categories: PHP Tags: object design refactoring
Refactoring the Cat API client - Part II
Categories: PHP Tags: object design refactoring
Refactoring the Cat API client - Part I
Categories: PHP Tags: object design refactoring
Experimenting with Broadway
Categories: PHP Symfony Tags: event sourcing Domain-Driven Design Broadway bundle serialization
Introducing the SymfonyBundlePlugins package
Categories: PHP Symfony Tags: plugin bundle
June 2015
January 2015
Lean publishing "Principles of Package Design"
Categories: PHP Book Tags: design principles reuse Principles of Package Design slides release
Collecting events and the event dispatching command bus
Categories: PHP Tags: hexagonal architecture commands command bus events event bus SimpleBus
Some questions about the command bus
Categories: PHP Tags: hexagonal architecture command bus events event bus SimpleBus
From commands to events
Categories: PHP Tags: hexagonal architecture command bus events event bus SimpleBus
Responsibilities of the command bus
Categories: PHP Tags: hexagonal architecture command bus SimpleBus
A wave of command buses
Categories: PHP Tags: hexagonal architecture command bus SimpleBus Laravel
December 2014
November 2014
Packages: the case for clones
Categories: PHP Tags: package design reuse dependencies
Decoupling from a service locator
Categories: PHP Symfony2 Tags: decoupling dependency inversion service container
October 2014
Symfony in Barcelona
Categories: PHP Symfony2 Tags: Elcodi community
Unnecessary contrapositions in the new "Symfony Best Practices"
Categories: PHP Symfony2 Tags: community
Composer "provide" and dependency inversion
Categories: PHP Tags: Composer package design
Announcements after a year with "A Year With Symfony"
Categories: PHP Symfony2 Book Tags: A Year With Symfony prizes
September 2014
Backwards compatible bundle releases
Categories: PHP Symfony2 Tags: bundle dependency injection service container package design
Semantic versioning for bundles
Categories: PHP Symfony2 Tags: bundle semver package design
Exposing resources: from Symfony bundles to packages
Categories: PHP Symfony2 Tags: bundles package design Puli
August 2014
Decoupling your (event) system
Categories: PHP Symfony2 Tags: events package design coupling
Symfony2: Event subsystems
Categories: PHP Symfony2 Tags: events
July 2014
Celebrating a year with "A Year With Symfony"
Categories: Book PHP Symfony2 Tags: A Year With Symfony prizes
The PHP testing experience: Interview by Fernando Arconada
Categories: PHP Testing Tags: interview TDD PHPUnit Behat Prophecy PHPSpec unit testing
A better PHP testing experience Part II: Pick your test doubles wisely
Categories: PHP Testing Tags: PHPUnit testing
A better PHP testing experience Part I: Moving away from assertion-centric unit testing
Categories: PHP Testing Tags: PHPUnit testing
A better PHP testing experience: Introduction
Categories: PHP Testing Tags: TDD PHPUnit Behat testing
June 2014
Symfony2: Framework independent controllers part 3: Loose ends
Categories: PHP Symfony Tags: controller reuse coupling Twig
Symfony2: Framework independent controllers part 2: Don't use annotations
Categories: PHP Symfony Tags: controller reuse coupling
Symfony2: How to create framework independent controllers?
Categories: PHP Symfony Tags: controller reuse coupling
May 2014
Inject a repository instead of an entity manager
Categories: PHP Symfony Tags: Doctrine ORM persistence reuse
Inject the ManagerRegistry instead of the EntityManager
Categories: PHP Symfony Tags: Doctrine ORM persistence reuse
April 2014
Book review: Modernizing Legacy Applications in PHP
Categories: Book review PHP Tags: book review legacy legacy code
Principles of PHP Package Design - First part of the book is now available
Categories: Book PHP Tags: package design Principles of Package Design release
There's no such thing as an optional dependency
Categories: Book PHP Tags: Composer coupling package design
March 2014
Test Symfony2 commands using the Process component and asynchronous assertions
Categories: PHP Symfony2 Testing Tags: asynchronicity console PHPUnit PID
About coding dojos, the Symfony meetup and my new book
Categories: Book PHP Symfony2 Talk Tags: coding dojo meetup Principles of Package Design
February 2014
A Year With Symfony: Bonus chapter is now available!
Categories: Book PHP Symfony2 Tags: A Year With Symfony annotations release
The "dark" side of PHP
Categories: Book PHP Tags: coupling package design
January 2014
Interview with Leanpub: A Year With Symfony
Categories: Book PHP Tags: A Year With Symfony interview Leanpub
PHP - The Future of Packages
Categories: Book PHP Tags: Composer package design Packagist quality PHP Classes
November 2013
October 2013
Symfony2: Some things I don't like about Bundles
Categories: PHP Symfony2 Tags: bundle configuration service container
Looking back at the release of "A Year With Symfony"
Categories: Book PHP Symfony2 Tags: A Year With Symfony Leanpub release
Symfony2: Console Commands as Services - Why?
Categories: PHP Symfony2 Tags: console dependency injection service container coupling
September 2013
Principles of PHP Package Design
Categories: PHP Talk Tags: AmsterdamPHP Leanpub Principles of Package Design slides
Symfony2 & TDD: Testing a Configuration Class
Categories: PHP Symfony2 Testing Tags: bundle configuration TDD
Official book presentation: A Year With Symfony
Categories: Book PHP Symfony2 Talk Tags: A Year With Symfony Leanpub meetup release
August 2013
July 2013
A New Book About Symfony2: A Year With Symfony
Categories: Book PHP Symfony2 Tags: A Year With Symfony Leanpub reuse
Symfony2: Rich Console Command Output Using AOP
Categories: PHP Symfony2 Tags: AOP console
June 2013
PHPUnit & Pimple: Integration Tests with a Simple DI Container
Categories: PHP Testing Tags: dependency injection PHPUnit Pimple service container reuse
Slides for my "Dependency Injection Smells" talk
Categories: PHP Talk Tags: dependency injection slides Dutch PHP Conference
Dependency Injection Smells - Speaking at the Dutch PHP Conference
Categories: Talk PHP Tags: dependency injection Dutch PHP Conference
May 2013
March 2013
February 2013
January 2013
Dependency injection smells
Categories: PHP Symfony2 Tags: dependency injection service container
Symfony2 & Twig: Collecting data across templates using a node visitor
Categories: PHP Symfony2 Twig Tags: extension templating
December 2012
November 2012
Symfony2: Application configuration for teams
Categories: PHP Symfony2 Tags: configuration
Experiences with PHP open source software in a Symfony-friendly environment
Categories: PHP Tags: package design Composer Git GitHub open source package design PHPUnit Travis CI
Combining GridFS files with ORM entities
Categories: PHP Symfony2 MongoDB Tags: controller forms MongoDB
October 2012
Uploading files to MongoDB GridFS
Categories: PHP Symfony2 MongoDB Tags: controller GridFS MongoDB
Symfony2 & MongoDB ODM: Adding the missing ParamConverter
Categories: PHP Symfony2 Tags: MongoDB request reuse
September 2012
Symfony2 & MongoDB ODM: Creating custom types with dependencies
Categories: PHP Symfony2 Tags: annotations MongoDB
Symfony2: Introduction to the Security Component part III
Categories: PHP Security Symfony2 Tags: authorization documentation roles voters
August 2012
July 2012
Symfony2: Introduction to the Security Component part I
Categories: PHP Security Symfony2 Tags: documentation firewall
Symfony2 Security: Using advanced Request matchers to activate firewalls
Categories: PHP Security Symfony2 Tags: compiler pass firewall request service container
Symfony Security Component & Silex: Adding a security voter for domain names
Categories: PHP Security Silex Symfony2 Tags: roles voters
Symfony2 Security: Creating dynamic roles (using RoleInterface)
Categories: PHP Security Symfony2 Tags: authorization roles
Silex: Using HttpFoundation and Doctrine DBAL in a Legacy PHP Application
Categories: PHP Silex Tags: legacy legacy code Doctrine DBAL HttpFoundation
June 2012
Let Silex Wrap Your Legacy PHP Application (and add Twig for templating)
Categories: PHP Silex Tags: Twig legacy code controller
Symfony2: Testing Your Controllers
Categories: PHP Symfony2 Testing Tags: PHPUnit controller functional testing unit testing
May 2012
Symfony2 Config Component: Config Definition and Processing
Categories: PHP Symfony2 Tags: configuration validation documentation
Symfony2 Config Component: Using FileLocator, Loaders and LoaderResolver
Categories: PHP Symfony2 Tags: configuration
April 2012
Symfony2 & JMSSerializerBundle: Vendor MIME types and API versioning
Categories: PHP Symfony2 Tags: annotations events request serializer service container
PHP: A Custom Stream Wrapper Part 2: Reading and Seeking
Categories: PHP Tags: stream wrapper
PHP: Create an Object-Oriented XML Parser using the Built-in xml_* Functions
Categories: PHP Tags: XML
PHP: Setting up a Stream Wrapper for Manipulating the DOM
Categories: PHP Tags: DOM stream wrapper
Symfony2: Setting up a Console-centered Application (with Composer)
Categories: PHP Symfony2 Tags: console
Symfony2 & Metadata: Caching Class- and PropertyMetadata
Categories: PHP Symfony2 Tags: annotations cache metadata reflection
March 2012
Symfony2: Writing a Yaml Driver for your Metadata Factory
Categories: PHP Symfony2 Tags: annotations configuration metadata reflection
Symfony2: Creating a Metadata Factory for Processing Custom Annotations
Categories: PHP Symfony2 Tags: annotations DocComment Doctrine Common reflection
Symfony2: creating a ParamConverter for deserializing request content
Categories: PHP Symfony2 Tags: annotations serializer
February 2012
Symfony2: Deserializing request content right into controller arguments
Categories: PHP Symfony2 Tags: annotations events reflection serializer
Silex: creating a service provider for Buzz
Categories: PHP Silex Tags: dependency injection Buzz reuse
How to Install Sismo
Categories: Testing PHP Tags: continuous integration Sismo
PHPUnit: Writing a Custom Assertion
Categories: PHP Testing Tags: PHPUnit assertion
Wordpress & Symfony2: using the CssSelector and FluentDOM to filter HTML snippets
Categories: PHP Symfony2 WordPress Tags: DOM CSS XPath
Silex: set up your project for testing with PHPUnit
Categories: PHP Testing Silex Tags: PHPUnit
January 2012
Silex: getting your project structure right
Categories: PHP Silex
The Symfony2 Serializer Component: create a Normalizer for JSON class hinting
Categories: PHP Symfony2 Tags: reflection serializer
Symfony2: dynamically add routes
Categories: PHP Symfony2 Tags: dependency injection routing
December 2011
Symfony2 & Doctrine Common: creating powerful annotations
Categories: PHP Tags: annotations Doctrine Common
Symfony2: Extending forms globally ("you know, like with CSRF protection")
Categories: PHP Symfony2 Tags: dependency injection events forms
November 2011
Symfony2: Creating a Validator with dependencies? Make it a service!
Categories: PHP Symfony2 Tags: validation service container dependency injection
Symfony2: An alternative to Symfony 1's "routing.load_configuration" event
Categories: PHP Symfony2 Tags: configuration events request routing
PHPUnit: create a ResultPrinter for output in the browser
Categories: PHP Testing Tags: PHPUnit
Symfony2: running PHPUnit from within a controller
Categories: PHP Testing Symfony2 Tags: PHPUnit controller
Symfony2: define your bundle's configuration values using the TreeBuilder
Categories: PHP Symfony2 Tags: dependency injection service container configuration
October 2011
Symfony2: use a bootstrap file for your PHPUnit tests and run some console commands
Categories: PHP Testing Symfony2 Tags: configuration PHPUnit console
Symfony2: how to create a custom Response using an event listener
Categories: PHP Symfony2 Tags: events request response
Use DocBlox in Symfony2 for inspecting DocComment blocks
Categories: PHP Symfony2 Tags: autoloader DocBlox reflection
Symfony2: create a response filter and set extra response headers
Categories: PHP Symfony2 Tags: dependency injection service container events response
Symfony2: How to create a UserProvider
Categories: PHP Security Symfony2 Tags: user provider authentication
Symfony2 service container: how to make your service use tags
Categories: PHP Symfony2 Tags: dependency injection service container compiler pass bundle