Skip to content

Releases

v0.3.0

Choose a tag to compare

@thesis-php-bot thesis-php-bot released this 17 Nov 03:03

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`

Choose a tag to compare

@vudaltsov vudaltsov released this 07 May 19:37

Changed

  • BC break Dispatcher::subscribe() now requires the hook class to be final. Passing a non-final class throws \ValueError.

See README for explanation.

0.1.0 Give it a try!

Choose a tag to compare

@vudaltsov vudaltsov released this 06 May 21:31

Initial release, check out README for details.