Code Duplication    Length = 15-16 lines in 4 locations

src/Graph/IndexDB.php 4 locations

@@ 76-90 (lines=15) @@
73
    /**
74
     * @inheritdocs
75
     */
76
    public function _class($name, $file, $start_line, $end_line, $namespace = null) {
77
        assert('is_string($name)');
78
        assert('$file->type() == "file"');
79
        assert('is_int($start_line)');
80
        assert('is_int($end_line)');
81
        assert('$namespace === null || $namespace->type() == "namespace"');
82
83
        $class = $this->create_node
84
            ( "class"
85
            ,   [ "name" => $name
86
                ]
87
            );
88
        $this->add_definition($class, $file, $start_line, $end_line, $namespace);
89
        return $class;
90
    }
91
92
    /**
93
     * @inheritdocs
@@ 95-109 (lines=15) @@
92
    /**
93
     * @inheritdocs
94
     */
95
    public function _interface($name, $file, $start_line, $end_line, $namespace = null) {
96
        assert('is_string($name)');
97
        assert('$file->type() == "file"');
98
        assert('is_int($start_line)');
99
        assert('is_int($end_line)');
100
        assert('$namespace === null || $namespace->type() == "namespace"');
101
102
        $interface = $this->create_node
103
            ( "interface"
104
            ,   [ "name" => $name
105
                ]
106
            );
107
        $this->add_definition($interface, $file, $start_line, $end_line, $namespace);
108
        return $interface;
109
    }
110
111
    /**
112
     * @inheritdocs
@@ 114-128 (lines=15) @@
111
    /**
112
     * @inheritdocs
113
     */
114
    public function _trait($name, $file, $start_line, $end_line, $namespace = null) {
115
        assert('is_string($name)');
116
        assert('$file->type() == "file"');
117
        assert('is_int($start_line)');
118
        assert('is_int($end_line)');
119
        assert('$namespace === null || $namespace->type() == "namespace"');
120
121
        $interface = $this->create_node
122
            ( "trait"
123
            ,   [ "name" => $name
124
                ]
125
            );
126
        $this->add_definition($interface, $file, $start_line, $end_line, $namespace);
127
        return $interface;
128
    }
129
130
    /**
131
     * @inheritdocs
@@ 155-170 (lines=16) @@
152
    /**
153
     * @inheritdocs
154
     */
155
    public function _function($name, $file, $start_line, $end_line, $namespace = null) {
156
        assert('is_string($name)');
157
        assert('$file->type() == "file"');
158
        assert('is_int($start_line)');
159
        assert('is_int($end_line)');
160
        assert('$namespace === null || $namespace->type() == "namespace"');
161
162
        $function = $this->create_node
163
            ( "function"
164
            ,   [ "name" => $name
165
                ]
166
            );
167
        $this->add_definition($function, $file, $start_line, $end_line, $namespace);
168
169
        return $function;
170
    }
171
172
    /**
173
     * @inheritdocs