Repository navigation
Releases
Releases · thesis-php/dispatcher
v0.3.0
The package moved to the Thesis monorepo and was written anew.
Added
Dispatcher::listens()tells whether any listener gets the events of a class.Dispatcher\listenersOf()gives the methods of an object marked#[Dispatcher\Listener]as listeners.
Changed
- BC break: Requires 64-bit PHP 8.5+.
- BC break: The listeners are given to the constructor as an iterable:
new Dispatcher($listeners). - BC break: A listener gets the events of the type of its first parameter: a class, an interface, a union,
an intersection, or every event (object,mixed, no type). The constructor rejects one that cannot take it. - A listener may take the events of a class that is not final and of an interface.
Removed
- BC break:
Dispatcher::subscribe()and its unsubscribe closures. Pass the listeners to the constructor.
0.2.0 Dispatcher::subscribe() now requires the hook class to be `final`
Changed
- BC break
Dispatcher::subscribe()now requires the hook class to befinal. Passing a non-final class throws\ValueError.
See README for explanation.
0.1.0 Give it a try!
Initial release, check out README for details.