Code Duplication    Length = 11-12 lines in 2 locations

src/Indexer/Indexer.php 2 locations

@@ 190-201 (lines=12) @@
187
    }
188
189
    // generalizes over calls to misc listeners
190
    protected function call_misc_listener($which, $node) {
191
        $listeners = &$this->$which;
192
        foreach ($listeners[0] as $listener) {
193
            $listener($this->insert, $this, $node);
194
        }
195
        $cls = get_class($node);
196
        if (array_key_exists($cls, $listeners)) {
197
            foreach ($listeners[$cls] as $listener) {
198
                $listener($this->insert, $this, $node);
199
            }
200
        }
201
    }
202
203
    protected function call_entity_listener($which, $type, $id, $node) {
204
        $listeners = &$this->$which;
@@ 203-213 (lines=11) @@
200
        }
201
    }
202
203
    protected function call_entity_listener($which, $type, $id, $node) {
204
        $listeners = &$this->$which;
205
        foreach ($listeners[0] as $listener) {
206
            $listener($this->insert, $this, $type, $id, $node);
207
        }
208
        if (array_key_exists($type, $listeners)) {
209
            foreach ($listeners[$type] as $listener) {
210
                $listener($this->insert, $this, $type, $id, $node);
211
            }
212
        }
213
    }
214
215
   // from Location
216