| Conditions | 6 |
| Paths | 9 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 6.027 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 1 | public function __construct(ClassLoader $loader = null) |
|
| 29 | { |
||
| 30 | 1 | if (!$loader) { |
|
| 31 | 1 | $loaders = spl_autoload_functions(); |
|
| 32 | 1 | foreach ($loaders as $loader) { |
|
| 33 | 1 | if (is_array($loader) && $loader[0] instanceof ClassLoader) { |
|
| 34 | 1 | $loader = $loader[0]; |
|
| 35 | 1 | break; |
|
| 36 | } |
||
| 37 | } |
||
| 38 | 1 | if (!$loader) { |
|
| 39 | throw new ReflectionException("Can not found a correct composer loader"); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | 1 | $this->loader = $loader; |
|
| 43 | 1 | } |
|
| 44 | |||
| 62 |