function DebugClassLoader::enable
Wraps all autoloaders.
1 call to DebugClassLoader::enable()
- Debug::enable in vendor/
symfony/ error-handler/ Debug.php
File
-
vendor/
symfony/ error-handler/ DebugClassLoader.php, line 184
Class
- DebugClassLoader
- Autoloader checking if the class is really defined in the file found.
Namespace
Symfony\Component\ErrorHandlerCode
public static function enable() : void {
// Ensures we don't hit https://bugs.php.net/42098
class_exists(ErrorHandler::class);
class_exists(\Psr\Log\LogLevel::class);
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
foreach ($functions as $function) {
spl_autoload_unregister($function);
}
foreach ($functions as $function) {
if (!\is_array($function) || !$function[0] instanceof self) {
$function = [
new static($function),
'loadClass',
];
}
spl_autoload_register($function);
}
}