ComposerClassMap   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A find() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace FlexFqcnFinder\Finder;
5
6
use Composer\Autoload\ClassLoader;
7
use FlexFqcnFinder\FqcnFinderInterface;
8
use ReflectionClass;
9
10
/**
11
 * Including all available classes (vendor + your project); use:
12
 * $ composer dump-autoload -o
13
 */
14
class ComposerClassMap implements FqcnFinderInterface
15
{
16
    public function find(): array
17
    {
18
        $reflection = new ReflectionClass(ClassLoader::class);
19
        $classMap = dirname($reflection->getFileName()) . DIRECTORY_SEPARATOR . "autoload_classmap.php";
20
        $classMapArray = require($classMap);
21
        return array_keys($classMapArray);
22
    }
23
}
24