Code Duplication    Length = 11-12 lines in 2 locations

src/Indexer/Indexer.php 2 locations

@@ 211-222 (lines=12) @@
208
     * @param   string          $which
209
     * @param   \PhpParser\Node $node
210
     */
211
    protected function call_misc_listener($which, \PhpParser\Node $node) {
212
        $listeners = &$this->$which;
213
        foreach ($listeners[0] as $listener) {
214
            $listener($this->insert, $this, $node);
215
        }
216
        $cls = get_class($node);
217
        if (array_key_exists($cls, $listeners)) {
218
            foreach ($listeners[$cls] as $listener) {
219
                $listener($this->insert, $this, $node);
220
            }
221
        }
222
    }
223
224
    /**
225
     * @param   string                  $which
@@ 230-240 (lines=11) @@
227
     * @param   int                     $type
228
     * @param   \PhpParser\Node|null    $node
229
     */
230
    protected function call_definition_listener($which, $type, $id, \PhpParser\Node $node = null) {
231
        $listeners = &$this->$which;
232
        foreach ($listeners[0] as $listener) {
233
            $listener($this->insert, $this, $type, $id, $node);
234
        }
235
        if (array_key_exists($type, $listeners)) {
236
            foreach ($listeners[$type] as $listener) {
237
                $listener($this->insert, $this, $type, $id, $node);
238
            }
239
        }
240
    }
241
242
   // from Location
243