[Debug] fixed typo that prevented smart errors for class not found errors to work

This commit is contained in:
Fabien Potencier 2013-08-30 09:34:07 +02:00
parent feff411dfc
commit f3e5994212

View File

@ -30,7 +30,7 @@ class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
public function handleError(array $error, FatalErrorException $exception) public function handleError(array $error, FatalErrorException $exception)
{ {
$messageLen = strlen($error['message']); $messageLen = strlen($error['message']);
$notFoundSuffix = '" not found'; $notFoundSuffix = '\' not found';
$notFoundSuffixLen = strlen($notFoundSuffix); $notFoundSuffixLen = strlen($notFoundSuffix);
if ($notFoundSuffixLen > $messageLen) { if ($notFoundSuffixLen > $messageLen) {
return; return;
@ -41,7 +41,7 @@ class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
} }
foreach (array('class', 'interface', 'trait') as $typeName) { foreach (array('class', 'interface', 'trait') as $typeName) {
$prefix = ucfirst($typeName).' "'; $prefix = ucfirst($typeName).' \'';
$prefixLen = strlen($prefix); $prefixLen = strlen($prefix);
if (0 !== strpos($error['message'], $prefix)) { if (0 !== strpos($error['message'], $prefix)) {
continue; continue;