Code Duplication    Length = 8-8 lines in 2 locations

src/ApiDocBuilder.php 2 locations

@@ 275-282 (lines=8) @@
272
            }
273
274
            // build array of functions per namespace
275
            foreach ($file->getFunctions() as $function) {
276
                $namespace = substr(PhpDomainBuilder::getNamespace($function), 0, -2);
277
                $namespace = $namespace === '' ? '\\' : $namespace;
278
                if (!array_key_exists($namespace, $this->functions)) {
279
                    $this->functions[$namespace] = [];
280
                }
281
                $this->functions[$namespace][] = $function;
282
            }
283
            // build array of constants per namespace
284
            foreach ($file->getConstants() as $constant) {
285
                $namespace = PhpDomainBuilder::getNamespace($constant);
@@ 284-291 (lines=8) @@
281
                $this->functions[$namespace][] = $function;
282
            }
283
            // build array of constants per namespace
284
            foreach ($file->getConstants() as $constant) {
285
                $namespace = PhpDomainBuilder::getNamespace($constant);
286
                $namespace = $namespace === '' ? '\\' : $namespace;
287
                if (!array_key_exists($namespace, $this->constants)) {
288
                    $this->constants[$namespace] = [];
289
                }
290
                $this->constants[$namespace][] = $constant;
291
            }
292
293
        }
294
    }