namespace Symfony\Component\Debug\FatalErrorHandler;
-use Symfony\Component\Debug\Exception\ClassNotFoundException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\DebugClassLoader;
use Composer\Autoload\ClassLoader as ComposerClassLoader;
use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader;
+use Symfony\Component\Debug\DebugClassLoader;
+use Symfony\Component\Debug\Exception\ClassNotFoundException;
+use Symfony\Component\Debug\Exception\FatalErrorException;
/**
* ErrorHandler for classes that do not exist.
*/
public function handleError(array $error, FatalErrorException $exception)
{
- $messageLen = strlen($error['message']);
+ $messageLen = \strlen($error['message']);
$notFoundSuffix = '\' not found';
- $notFoundSuffixLen = strlen($notFoundSuffix);
+ $notFoundSuffixLen = \strlen($notFoundSuffix);
if ($notFoundSuffixLen > $messageLen) {
return;
}
foreach (array('class', 'interface', 'trait') as $typeName) {
$prefix = ucfirst($typeName).' \'';
- $prefixLen = strlen($prefix);
+ $prefixLen = \strlen($prefix);
if (0 !== strpos($error['message'], $prefix)) {
continue;
}
*/
private function getClassCandidates($class)
{
- if (!is_array($functions = spl_autoload_functions())) {
+ if (!\is_array($functions = spl_autoload_functions())) {
return array();
}
$classes = array();
foreach ($functions as $function) {
- if (!is_array($function)) {
+ if (!\is_array($function)) {
continue;
}
// get class loaders wrapped by DebugClassLoader
if ($function[0] instanceof DebugClassLoader) {
$function = $function[0]->getClassLoader();
- if (!is_array($function)) {
+ if (!\is_array($function)) {
continue;
}
}
*/
private function findClassInPath($path, $class, $prefix)
{
- if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
+ if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
return array();
}
{
$candidates = array(
// namespaced class
- $namespacedClass = str_replace(array($path.DIRECTORY_SEPARATOR, '.php', '/'), array('', '', '\\'), $file),
+ $namespacedClass = str_replace(array($path.\DIRECTORY_SEPARATOR, '.php', '/'), array('', '', '\\'), $file),
// namespaced class (with target dir)
$prefix.$namespacedClass,
// namespaced class (with target dir and separator)