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