Code Duplication    Length = 8-8 lines in 2 locations

src/BufferedEventDispatcher.php 2 locations

@@ 47-54 (lines=8) @@
44
        return $events;
45
    }
46
47
    public function subscribeTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
48
    {
49
        if ( ! $this->dispatcher instanceof ListenerRegistry) {
50
            throw UnableToSubscribeListener::becauseTheEventDispatcherDoesNotAcceptListeners($this->dispatcher);
51
        }
52
53
        $this->dispatcher->subscribeTo($event, $listener, $priority);
54
    }
55
56
    public function subscribeOnceTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
57
    {
@@ 56-63 (lines=8) @@
53
        $this->dispatcher->subscribeTo($event, $listener, $priority);
54
    }
55
56
    public function subscribeOnceTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
57
    {
58
        if ( ! $this->dispatcher instanceof ListenerRegistry) {
59
            throw UnableToSubscribeListener::becauseTheEventDispatcherDoesNotAcceptListeners($this->dispatcher);
60
        }
61
62
        $this->dispatcher->subscribeOnceTo($event, $listener, $priority);
63
    }
64
65
    public function subscribeListenersFrom(ListenerSubscriber $subscriber): void
66
    {