Code Duplication    Length = 11-12 lines in 2 locations

src/Indexer/Indexer.php 2 locations

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