These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | @trigger_error("This autoloader just for dummy testing. Just run 'composer dump-autoload --optimize' and you're set.", E_USER_DEPRECATED); |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | \spl_autoload_register(function($className) { |
||
6 | $rootDir = __DIR__ . DIRECTORY_SEPARATOR . 'src'; |
||
7 | |||
8 | $namespace = 'DependencyInjection'; |
||
9 | |||
10 | $className = str_replace( |
||
11 | '\\', |
||
12 | DIRECTORY_SEPARATOR, |
||
13 | str_replace($namespace, $rootDir, $className) |
||
14 | ); |
||
15 | |||
16 | $className .= '.php'; |
||
17 | |||
18 | if ($file = stream_resolve_include_path($className)) { |
||
19 | require_once $file; |
||
20 | } |
||
21 | }); |
||
22 |
If you suppress an error, we recommend checking for the error condition explicitly: