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
  • Pro

3. The base Event

06:41
  • Pro

4. Refactoring with reflection

04:02
  • Pro

5. Listeners

05:39
  • Pro

6. Adding listeners to the dispatcher

05:13
  • Pro

7. Fetching listeners

05:12
  • Pro

8. Dispatching events

07:22
  • Pro

9. Pulling it together

07:41
  • Pro