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]);
            }
        }
    }