protected function ensureEvent($event)
    {
        if (is_string($event)) {
            return Event::named($event);
        }

        if (! $event instanceof EventInterface) {
            throw new InvalidArgumentException('Events should be provides as Event instances or string, received type: '.gettype($event));
        }

        return $event;
    }
protected function ensureEvent($event)
    {
        if (is_string($event)) {
            return Event::named($event);
        }

        if (! $event instanceof EventInterface) {
            throw new InvalidArgumentException('Events should be provides as Event instances or string, received type: '.gettype($event));
        }

        return $event;
    }
protected function ensureEvent ( $ event ) { if ( is_string ( $ event ) ) { return Event :: named ( $ event ) ; } if ( ! $ event instanceof EventInterface ) { throw new InvalidArgumentException ( 'Events should be provides as Event instances or string, received type: ' . gettype ( $ event ) ) ; } return $ event ; }
Ensure event input is of type EventInterface or convert it.

@param string|EventInterface $event

@throws InvalidArgumentException

@return EventInterface
Ensure event input is of type EventInterface or convert it .