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

0.2.1 2024-11-25 12:35 UTC

This package is auto-updated.

Last update: 2025-09-29 03:08:10 UTC


README

composer require zarganwar/symfony-event-dispatcher-utils

Usage

  1. Install this lib
  2. Create Subscriber with __invoke method and with typed $event parameter
  3. Type of parameter must be a class, interface or union types
  4. Declare use Trait from this package
  5. Enjoy 😉

Example

class CoolSubscriber implements Symfony\Component\EventDispatcher\EventSubscriberInterface
{
    use Zarganwar\SymfonyEventDispatcherUtils\AutoEventSubscriberTrait;

    public function __invoke(CoolEvent $event): void
    {
        // Be Cool
    }

}