Code Duplication    Length = 15-16 lines in 4 locations

src/Graph/IndexDB.php 4 locations

@@ 86-100 (lines=15) @@
83
    /**
84
     * @inheritdocs
85
     */
86
    public function _class($name, $file, $start_line, $end_line, $namespace = null) {
87
        assert('is_string($name)');
88
        assert('$file->type() == "file"');
89
        assert('is_int($start_line)');
90
        assert('is_int($end_line)');
91
        assert('$namespace === null || $namespace->type() == "namespace"');
92
93
        $class = $this->create_node
94
            ( "class"
95
            ,   [ "name" => $name
96
                ]
97
            );
98
        $this->add_definition($class, $file, $start_line, $end_line, $namespace);
99
        return $class;
100
    }
101
102
    /**
103
     * @inheritdocs
@@ 105-119 (lines=15) @@
102
    /**
103
     * @inheritdocs
104
     */
105
    public function _interface($name, $file, $start_line, $end_line, $namespace = null) {
106
        assert('is_string($name)');
107
        assert('$file->type() == "file"');
108
        assert('is_int($start_line)');
109
        assert('is_int($end_line)');
110
        assert('$namespace === null || $namespace->type() == "namespace"');
111
112
        $interface = $this->create_node
113
            ( "interface"
114
            ,   [ "name" => $name
115
                ]
116
            );
117
        $this->add_definition($interface, $file, $start_line, $end_line, $namespace);
118
        return $interface;
119
    }
120
121
    /**
122
     * @inheritdocs
@@ 124-138 (lines=15) @@
121
    /**
122
     * @inheritdocs
123
     */
124
    public function _trait($name, $file, $start_line, $end_line, $namespace = null) {
125
        assert('is_string($name)');
126
        assert('$file->type() == "file"');
127
        assert('is_int($start_line)');
128
        assert('is_int($end_line)');
129
        assert('$namespace === null || $namespace->type() == "namespace"');
130
131
        $interface = $this->create_node
132
            ( "trait"
133
            ,   [ "name" => $name
134
                ]
135
            );
136
        $this->add_definition($interface, $file, $start_line, $end_line, $namespace);
137
        return $interface;
138
    }
139
140
    /**
141
     * @inheritdocs
@@ 165-180 (lines=16) @@
162
    /**
163
     * @inheritdocs
164
     */
165
    public function _function($name, $file, $start_line, $end_line, $namespace = null) {
166
        assert('is_string($name)');
167
        assert('$file->type() == "file"');
168
        assert('is_int($start_line)');
169
        assert('is_int($end_line)');
170
        assert('$namespace === null || $namespace->type() == "namespace"');
171
172
        $function = $this->create_node
173
            ( "function"
174
            ,   [ "name" => $name
175
                ]
176
            );
177
        $this->add_definition($function, $file, $start_line, $end_line, $namespace);
178
179
        return $function;
180
    }
181
182
    /**
183
     * @inheritdocs