Code Duplication    Length = 22-22 lines in 2 locations

src/Graph/IndexDB.php 2 locations

@@ 217-238 (lines=22) @@
214
    /**
215
     * @inheritdocs
216
     */
217
    public function _method_reference($name, $file, $line, $column) {
218
        assert('is_string($name)');
219
        assert('$file->type() == "file"');
220
        assert('is_int($line)');
221
222
        $key = $name."_".$file->property("path")."_".$line."_".$column;
223
224
        if (array_key_exists($key, $this->method_references)) {
225
            return $this->method_references[$key];
226
        }
227
228
        $method = $this->create_node("method reference", ["name" => $name]);
229
        $this->add_relation
230
            ( $method
231
            , "referenced at"
232
            , ["line" => $line, "column" => $column]
233
            , $file
234
            );
235
236
        $this->method_references[$key] = $method;
237
        return $method;
238
    }
239
240
    /**
241
     * @inheritdocs
@@ 243-264 (lines=22) @@
240
    /**
241
     * @inheritdocs
242
     */
243
    public function _function_reference($name, $file, $line, $column) {
244
        assert('is_string($name)');
245
        assert('$file->type() == "file"');
246
        assert('is_int($line)');
247
248
        $key = $name."_".$file->property("path")."_".$line."_".$column;
249
250
        if (array_key_exists($key, $this->function_references)) {
251
            return $this->function_references[$key];
252
        }
253
254
        $function = $this->create_node("function reference", ["name" => $name]);
255
        $this->add_relation
256
            ( $function
257
            , "referenced at"
258
            , ["line" => $line, "column" => $column]
259
            , $file
260
            );
261
262
        $this->function_references[$key] = $function;
263
        return $function;
264
    }
265
266
    /**
267
     * @inheritdocs