src/Viserio/Component/Events/EventManager.php
protected function removeListenerPattern(string $eventPattern, $listener): void
    {
        if (empty($this->patterns[$eventPattern])) {
            return;
        }

        /** @var ListenerPattern $pattern */
        foreach ($this->patterns[$eventPattern] as $key => $pattern) {
            if ($listener === $pattern->getListener()) {
                $pattern->unbind($this);

                unset($this->patterns[$eventPattern][$key]);
            }
        }
    }
protected function removeListenerPattern(string $eventPattern, $listener): void
    {
        if (empty($this->patterns[$eventPattern])) {
            return;
        }

        /** @var ListenerPattern $pattern */
        foreach ($this->patterns[$eventPattern] as $key => $pattern) {
            if ($listener === $pattern->getListener()) {
                $pattern->unbind($this);

                unset($this->patterns[$eventPattern][$key]);
            }
        }
    }
Removes an event listener from any events to which it was applied due to
pattern matching.

This method cannot be used to remove a listener from a pattern that was
never registered.

@param string $eventPattern
@param mixed  $listener

@return void