Doctrine Event Manager is a PHP library that implements a publish-subscribe pattern for decoupled application communication. It provides a simple event bus that dispatches named events to registered listeners, enabling components to communicate without direct method calls and promoting loose coupling and extensibility in PHP projects.
The library manages listener callbacks in a central registry keyed by exact event name strings for fast lookup, and invokes listeners in priority sequence for controlled reaction order during event dispatch. It maintains no internal state between dispatches, relying solely on the listener registry for event handling, and invokes all listeners sequentially on the same thread for predictable and deterministic execution order.
Event names are treated independently without parent-child hierarchy or wildcard patterns, and event objects are created only at dispatch time to avoid memory allocation for unused events. The library is available as a standalone package installable via Composer.