Code Duplication    Length = 8-8 lines in 2 locations

src/EventDispatcher.php 2 locations

@@ 57-64 (lines=8) @@
54
        }
55
    }
56
57
    public function subscribeTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
58
    {
59
        if ( ! $this->listenerProvider instanceof ListenerAcceptor) {
60
            throw UnableToSubscribeListener::becauseTheListenerProviderDoesNotAcceptListeners($this->listenerProvider);
61
        }
62
63
        $this->listenerProvider->subscribeTo($event, $listener, $priority);
64
    }
65
66
    public function subscribeOnceTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
67
    {
@@ 66-73 (lines=8) @@
63
        $this->listenerProvider->subscribeTo($event, $listener, $priority);
64
    }
65
66
    public function subscribeOnceTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
67
    {
68
        if ( ! $this->listenerProvider instanceof ListenerAcceptor) {
69
            throw UnableToSubscribeListener::becauseTheListenerProviderDoesNotAcceptListeners($this->listenerProvider);
70
        }
71
72
        $this->listenerProvider->subscribeOnceTo($event, $listener, $priority);
73
    }
74
75
    public function subscribeListenersFrom(ListenerSubscriber $subscriber): void
76
    {