Code Duplication    Length = 12-13 lines in 2 locations

src/Indexer/Indexer.php 2 locations

@@ 195-207 (lines=13) @@
192
     * @param   string          $which
193
     * @param   \PhpParser\Node $node
194
     */
195
    protected function call_misc_listener($which) {
196
        $listeners = &$this->$which;
197
        $current_node = $this->location->current_node();
198
        foreach ($listeners[0] as $listener) {
199
            $listener($this->insert, $this->location, $current_node);
200
        }
201
        $cls = get_class($current_node);
202
        if (array_key_exists($cls, $listeners)) {
203
            foreach ($listeners[$cls] as $listener) {
204
                $listener($this->insert, $this->location, $current_node);
205
            }
206
        }
207
    }
208
209
    /**
210
     * @param   string                  $which
@@ 215-226 (lines=12) @@
212
     * @param   int                     $type
213
     * @param   \PhpParser\Node|null    $node
214
     */
215
    protected function call_definition_listener($which, $type, $id) {
216
        $listeners = &$this->$which;
217
        $current_node = $this->location->current_node();
218
        foreach ($listeners[0] as $listener) {
219
            $listener($this->insert, $this->location, $type, $id, $current_node);
220
        }
221
        if (array_key_exists($type, $listeners)) {
222
            foreach ($listeners[$type] as $listener) {
223
                $listener($this->insert, $this->location, $type, $id, $current_node);
224
            }
225
        }
226
    }
227
228
    // from \PhpParser\NodeVisitor
229