Code Duplication    Length = 12-13 lines in 2 locations

src/Indexer/Indexer.php 2 locations

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