src/Viserio/Component/Events/EventManager.php
public function attach(string $eventName, $listener, int $priority = 0): void
    {
        $this->validateEventName($eventName);

        if ($this->hasWildcards($eventName)) {
            $this->addListenerPattern(new ListenerPattern($eventName, $listener, $priority));
        } else {
            $this->listeners[$eventName][$priority][] = $listener;

            unset($this->sorted[$eventName]);
        }
    }
public function attach(string $eventName, $listener, int $priority = 0): void
    {
        $this->validateEventName($eventName);

        if ($this->hasWildcards($eventName)) {
            $this->addListenerPattern(new ListenerPattern($eventName, $listener, $priority));
        } else {
            $this->listeners[$eventName][$priority][] = $listener;

            unset($this->sorted[$eventName]);
        }
    }
{@inheritdoc}