public function addListener($handler, callable $callable)
    {
        if (!class_exists($handler)) {
            throw new \InvalidArgumentException(sprintf('Invlaid Handler "%s"', $handler));
        }

        if (!is_subclass_of($handler, Event::class)) {
            throw new \InvalidArgumentException(sprintf(
                'The Handler "%s" must be extends "%s"', $handler, Event::class));
        }

        $this->listeners[$handler] = $callable;

        return $this;
    }
public function addListener($handler, callable $callable)
    {
        if (!class_exists($handler)) {
            throw new \InvalidArgumentException(sprintf('Invlaid Handler "%s"', $handler));
        }

        if (!is_subclass_of($handler, Event::class)) {
            throw new \InvalidArgumentException(sprintf(
                'The Handler "%s" must be extends "%s"', $handler, Event::class));
        }

        $this->listeners[$handler] = $callable;

        return $this;
    }
public function addListener ( $ handler , callable $ callable ) { if ( ! class_exists ( $ handler ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invlaid Handler "%s"' , $ handler ) ) ; } if ( ! is_subclass_of ( $ handler , Event :: class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The Handler "%s" must be extends "%s"' , $ handler , Event :: class ) ) ; } $ this -> listeners [ $ handler ] = $ callable ; return $ this ; }
add listener.
add listener .