| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 2 | public static function autoload($class) |
|
| 44 | { |
||
| 45 | 2 | $prefixLength = strlen(self::NAMESPACE_PREFIX); |
|
| 46 | 2 | if (0 === strncmp(self::NAMESPACE_PREFIX, $class, $prefixLength)) { |
|
| 47 | 1 | $file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength)); |
|
| 48 | 1 | $file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php'); |
|
| 49 | 1 | if (file_exists($file)) { |
|
| 50 | /** @noinspection PhpIncludeInspection Dynamic includes */ |
||
| 51 | require_once $file; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | 2 | } |
|
| 55 | } |
||
| 56 |