public function bind(EventManagerContract $dispatcher, string $eventName): void
    {
        if (isset($this->events[$eventName])) {
            return;
        }

        $dispatcher->attach($eventName, $this->getListener(), $this->priority);
        $this->events[$eventName] = true;
    }
public function bind(EventManagerContract $dispatcher, string $eventName): void
    {
        if (isset($this->events[$eventName])) {
            return;
        }

        $dispatcher->attach($eventName, $this->getListener(), $this->priority);
        $this->events[$eventName] = true;
    }
public function bind ( EventManagerContract $ dispatcher , string $ eventName ) : void { if ( isset ( $ this -> events [ $ eventName ] ) ) { return ; } $ dispatcher -> attach ( $ eventName , $ this -> getListener ( ) , $ this -> priority ) ; $ this -> events [ $ eventName ] = true ; }
Adds this pattern's listener to an event.

@param \Viserio\Component\Contract\Events\EventManager $dispatcher
@param string                                          $eventName

@return void
Adds this pattern s listener to an event .