Code Duplication    Length = 12-13 lines in 2 locations

src/Indexer/ASTVisitor.php 2 locations

@@ 68-80 (lines=13) @@
65
    /**
66
     * @param   string          $which
67
     */
68
    protected function call_misc_listener($which) {
69
        $listeners = &$this->$which;
70
        $current_node = $this->location->current_node();
71
        foreach ($listeners[0] as $listener) {
72
            $listener($this->insert, $this->location, $current_node);
73
        }
74
        $cls = get_class($current_node);
75
        if (array_key_exists($cls, $listeners)) {
76
            foreach ($listeners[$cls] as $listener) {
77
                $listener($this->insert, $this->location, $current_node);
78
            }
79
        }
80
    }
81
82
    /**
83
     * @param   string                  $which
@@ 87-98 (lines=12) @@
84
     * @param   string                  $type
85
     * @param   int                     $type
86
     */
87
    protected function call_definition_listener($which, $type, $id) {
88
        $listeners = &$this->$which;
89
        $current_node = $this->location->current_node();
90
        foreach ($listeners[0] as $listener) {
91
            $listener($this->insert, $this->location, $type, $id, $current_node);
92
        }
93
        if (array_key_exists($type, $listeners)) {
94
            foreach ($listeners[$type] as $listener) {
95
                $listener($this->insert, $this->location, $type, $id, $current_node);
96
            }
97
        }
98
    }
99
100
    // from \PhpParser\NodeVisitor
101