course

Roll your own event dispatcher

Going back to raw PHP, let's test and build an event dispatcher. We'll cover test-driven development, mocking, the PHP reflection API and the observer pattern.

Watch this course

1. Introduction

03:37

2. PHPUnit setup

03:57

3. The base Event

06:41

4. Refactoring with reflection

04:02

5. Listeners

05:39

6. Adding listeners to the dispatcher

05:13

7. Fetching listeners

05:12

8. Dispatching events

07:22

9. Pulling it together

07:41