RSSAmplifier

Blog

Doeke Norg - Articles on PHP design patterns, testing strategies, data structures, and clean architecture.

doeken.orgRSS feed ↗20 posts

Latest posts

PSR-20 Clocks: Testable Time in PHP

Learn how a ClockInterface helps you decouple time and write stable, testable code.

Exploring Coroutines in PHP

Coroutines are functions that can pause and resume execution while remembering their internal state, enabling bi-directional communication.

The infamous Repository Pattern in PHP

The repository pattern is a data source abstraction that behaves like a collection; containing domain (value) objects.

Stop mocking about: Event Dispatcher

How to replace your mocked event dispatchers with a real one, and why.

(Singly) Linked Lists explained in PHP

Linked lists are a linear data structure that provides quick insertion and deletion.

How the PHP Middleware Pattern works and can easily be applied

The Middleware Pattern allows you to easily change the input and output of an action; one layer at a time.

Heaps explained in PHP

Heaps are an effective data structure for quick access to the highest value of a dataset.

Using the Visitor Pattern in PHP

The Visitor Pattern opens up your entities to extension without changing them (much); and keeps the code separate.

Trees and Tree Traversal in PHP

In this post I want to introduce you to Tree structures. What they are, how you can use them, and in which situation they can be helpful.

Adapter Pattern vs. Bridge Pattern

The Adapter pattern and the Bridge Pattern have brought along a lot of confusion. Time to connect the dots.

What happens when we clone?

Cloning is a nice way of creating a quick copy of an object. But there are some things you need to be aware of!

Decorator Pattern vs. Proxy Pattern

Although similar, Decorators and Proxies are not the same. It all depends on their intent.

How to use symfony/mailer without the Symfony Framework

Now that Swiftmailer is (almost) dead, let s meet its replacement.

Introducing Iterator Functions

doekenorg/iterator-functions provides array-like functions that will ease the use of iterators & generators.

Generators over arrays

Learn more about these supercharged arrays that can preserve memory.

Event Dispatching

An exploration into events and their workings within multiple frameworks.

Validate method parameters using callbacks in PHPUnit

Save yourself from (re)creating difficult objects for simple assertions.

Group multiple boolean attributes in Laravel Nova

Streamline and minimize your UI by customizing a BooleanGroup.

Custom Access Tokens in Laravel Sanctum

How to create single-use access tokens and more with a simple callable.

Testing Traits in PHPUnit

Composition over inheritance by using traits; but how can you test these traits in more complex use cases?