Code Duplication    Length = 15-15 lines in 3 locations

src/Dispatcher/ClassEventDispatcher.php 1 location

@@ 97-111 (lines=15) @@
94
     *
95
     * @return
96
     */
97
    public function buildAndNotify($name, $object, array $headers = [], $eventClass = false, $type = false)
98
    {
99
        if (!$this->hasListeners($name, ($object))) {
100
            return false;
101
        }
102
103
        return $this->notify(
104
                $name,
105
                EventBuilder::getInstance($eventClass)->build(
106
                    $object,
107
                    $name,
108
                    $headers,
109
                    (string) $type
110
                )
111
        );
112
    }
113
114
    /**

src/Dispatcher/EventClassDispatcher.php 1 location

@@ 60-74 (lines=15) @@
57
     *
58
     * @return
59
     */
60
    public function buildAndNotify($name, $object, array $headers = [], $eventClass = false, $type = false)
61
    {
62
        if (!$this->hasListeners($name, ($object))) {
63
            return false;
64
        }
65
66
        return $this->notify(
67
                $name,
68
                EventBuilder::getInstance($eventClass)->build(
69
                    $object,
70
                    $name,
71
                    $headers,
72
                    (string) $type
73
                )
74
        );
75
    }
76
77
    /**

src/Dispatcher/ObjectEventDispatcher.php 1 location

@@ 68-82 (lines=15) @@
65
     *
66
     * @see EventBuilder
67
     */
68
    public function buildAndNotify($name, $object, array $headers = [], $eventClass = false, $type = false)
69
    {
70
        if (!$this->hasListeners($name, $object)) {
71
            return false;
72
        }
73
        $event = EventBuilder::getInstance($eventClass)->build(
74
            $object,
75
            $name,
76
            $headers
77
        );
78
        $this->notify(
79
                $name,
80
                $event
81
        );
82
83
        return $event;
84
    }
85
}