Code Duplication    Length = 11-12 lines in 2 locations

src/Indexer/Indexer.php 2 locations

@@ 183-194 (lines=12) @@
180
     * @param   string          $which
181
     * @param   \PhpParser\Node $node
182
     */
183
    protected function call_misc_listener($which, \PhpParser\Node $node) {
184
        $listeners = &$this->$which;
185
        foreach ($listeners[0] as $listener) {
186
            $listener($this->insert, $this, $node);
187
        }
188
        $cls = get_class($node);
189
        if (array_key_exists($cls, $listeners)) {
190
            foreach ($listeners[$cls] as $listener) {
191
                $listener($this->insert, $this, $node);
192
            }
193
        }
194
    }
195
196
    /**
197
     * @param   string                  $which
@@ 202-212 (lines=11) @@
199
     * @param   int                     $type
200
     * @param   \PhpParser\Node|null    $node
201
     */
202
    protected function call_entity_listener($which, $type, $id, \PhpParser\Node $node = null) {
203
        $listeners = &$this->$which;
204
        foreach ($listeners[0] as $listener) {
205
            $listener($this->insert, $this, $type, $id, $node);
206
        }
207
        if (array_key_exists($type, $listeners)) {
208
            foreach ($listeners[$type] as $listener) {
209
                $listener($this->insert, $this, $type, $id, $node);
210
            }
211
        }
212
    }
213
214
   // from Location
215