Skip to content

Zarganwar/symfony-event-dispatcher-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

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
    }

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages