src/EventCacheTrait.php
protected function _getCachedEvent($event, array $args = [])
    {
        $name = ($event instanceof EventInterface)
            ? $event->getName()
            : $event;

        // Create event instance if it does not exist
        if (!$this->_hasCachedEvent($name)) {
            $this->_createCachedEvent($event, $args);
        }

        return $this->eventCache[$name];
    }
protected function _getCachedEvent($event, array $args = [])
    {
        $name = ($event instanceof EventInterface)
            ? $event->getName()
            : $event;

        // Create event instance if it does not exist
        if (!$this->_hasCachedEvent($name)) {
            $this->_createCachedEvent($event, $args);
        }

        return $this->eventCache[$name];
    }
Gets the cached event instance for the given name, creating it if needed.

@since [*next-version*]

@param string|Stringable|EventInterface $event The name of the event, or the event instance.
@param array                            $args  Optional array of event arguments.

@return EventInterface The event instance.