zarganwar / symfony-event-dispatcher-utils
description
Installs: 304
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/zarganwar/symfony-event-dispatcher-utils
Requires
- php: >=8.0
Requires (Dev)
- nette/tester: ^2.5
- phpstan/phpstan: ^2.0
README
composer require zarganwar/symfony-event-dispatcher-utils
Usage
- Install this lib
- Create Subscriber with __invoke method and with typed $event parameter
- Type of parameter must be a class, interface or union types
- Declare use Trait from this package
- Enjoy 😉
Example
class CoolSubscriber implements Symfony\Component\EventDispatcher\EventSubscriberInterface { use Zarganwar\SymfonyEventDispatcherUtils\AutoEventSubscriberTrait; public function __invoke(CoolEvent $event): void { // Be Cool } }