Code Duplication    Length = 8-8 lines in 2 locations

src/BufferedEventDispatcher.php 2 locations

@@ 38-45 (lines=8) @@
35
        }
36
    }
37
38
    public function subscribeTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
39
    {
40
        if ( ! $this->dispatcher instanceof ListenerAcceptor) {
41
            throw UnableToSubscribeListener::becauseTheEventDispatcherDoesNotAcceptListeners($this->dispatcher);
42
        }
43
44
        $this->dispatcher->subscribeTo($event, $listener, $priority);
45
    }
46
47
    public function subscribeOnceTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
48
    {
@@ 47-54 (lines=8) @@
44
        $this->dispatcher->subscribeTo($event, $listener, $priority);
45
    }
46
47
    public function subscribeOnceTo(string $event, callable $listener, int $priority = ListenerPriority::NORMAL): void
48
    {
49
        if ( ! $this->dispatcher instanceof ListenerAcceptor) {
50
            throw UnableToSubscribeListener::becauseTheEventDispatcherDoesNotAcceptListeners($this->dispatcher);
51
        }
52
53
        $this->dispatcher->subscribeOnceTo($event, $listener, $priority);
54
    }
55
56
    public function subscribeListenersFrom(ListenerSubscriber $subscriber): void
57
    {