src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php
protected function addListenerPattern(ListenerPattern $pattern)
    {
        $this->patterns[$pattern->getEventPattern()][] = $pattern;

        foreach ($this->syncedEvents as $eventName => $_) {
            if ($pattern->test($eventName)) {
                unset($this->syncedEvents[$eventName]);
            }
        }
    }
protected function addListenerPattern(ListenerPattern $pattern)
    {
        $this->patterns[$pattern->getEventPattern()][] = $pattern;

        foreach ($this->syncedEvents as $eventName => $_) {
            if ($pattern->test($eventName)) {
                unset($this->syncedEvents[$eventName]);
            }
        }
    }
protected function addListenerPattern ( ListenerPattern $ pattern ) { $ this -> patterns [ $ pattern -> getEventPattern ( ) ] [ ] = $ pattern ; foreach ( $ this -> syncedEvents as $ eventName => $ _ ) { if ( $ pattern -> test ( $ eventName ) ) { unset ( $ this -> syncedEvents [ $ eventName ] ) ; } } }
Adds an event listener for all events matching the specified pattern.

This method will lazily register the listener when a matching event is
dispatched.

@param ListenerPattern $pattern
Adds an event listener for all events matching the specified pattern .