Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
24 | public function __construct() |
||
25 | { |
||
26 | 8 | $composer = Sequence::of(...get_declared_classes())->filter(static function(string $class): bool { |
|
27 | 8 | return (string) Str::of($class)->substring(0, 22) === 'ComposerAutoloaderInit'; |
|
28 | 8 | }); |
|
29 | |||
30 | //use the last as there may be 2 classes, the first being the global autoloader |
||
31 | 8 | $refl = new \ReflectionClass((string) $composer->last()); |
|
32 | 8 | $vendorPath = dirname(dirname($refl->getFileName())); |
|
33 | |||
34 | 8 | $this->vendorPath = Str::of($vendorPath)->append('/'); |
|
35 | 8 | } |
|
50 |