| Total Complexity | 3 | 
| Total Lines | 27 | 
| Duplicated Lines | 0 % | 
| Coverage | 100% | 
| Changes | 0 | ||
| 1 | <?php | ||
| 20 | final class Composer implements PathResolver | ||
| 21 | { | ||
| 22 | private $vendorPath; | ||
| 23 | |||
| 24 | public function __construct() | ||
| 25 |     { | ||
| 26 | 17 |         $composer = Sequence::of(...get_declared_classes())->filter(static function(string $class): bool { | |
| 27 | 17 | return (string) Str::of($class)->substring(0, 22) === 'ComposerAutoloaderInit'; | |
| 28 | 17 | }); | |
| 29 | |||
| 30 | //use the last as there may be 2 classes, the first being the global autoloader | ||
| 31 | 17 | $refl = new \ReflectionClass((string) $composer->last()); | |
| 32 | 17 | $vendorPath = dirname(dirname($refl->getFileName())); | |
| 33 | |||
| 34 | 17 |         $this->vendorPath = Str::of($vendorPath)->append('/'); | |
| 35 | 17 | } | |
| 36 | |||
| 37 | 13 | public function __invoke(PathInterface $from, PathInterface $to): PathInterface | |
| 47 | ); | ||
| 48 | } | ||
| 50 |