| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 4 | public function __construct(?Options $options) |
|
| 24 | { |
||
| 25 | 4 | if ($options === null || !$options->getAutoloaderPath()) { |
|
| 26 | 1 | return; |
|
| 27 | } |
||
| 28 | |||
| 29 | // Note: the loader is automatically registered |
||
| 30 | // @todo figure out how to unregister the loader to avoid conflicts |
||
| 31 | 4 | $this->autoloader = require $options->getAutoloaderPath(); |
|
| 32 | |||
| 33 | 4 | $vendorRoot = dirname($options->getAutoloaderPath()); |
|
| 34 | 4 | $SEP = \DIRECTORY_SEPARATOR === '/' ? '/' : '[' . preg_quote(\DIRECTORY_SEPARATOR, '@') . '/]'; |
|
| 35 | 4 | $this->pathRegex = '@^' . preg_quote($vendorRoot, '@') . "${SEP}(?:composer${SEP}\.\.${SEP})?([^${SEP}]+${SEP}[^${SEP}]+)${SEP}@"; |
|
| 36 | 4 | } |
|
| 54 |