Skip to content

Commit ca46f5e

Browse files
committed
uop
1 parent 7c19d97 commit ca46f5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function handleError(array $error, FatalErrorException $exception)
3636

3737
$message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className);
3838

39-
if (null === $methods = get_class_methods($className)) {
39+
if (!class_exists($className) || null === $methods = get_class_methods($className)) {
40+
// failed to get the class or its methods on which an unknown method was called (for example on an anonymous class)
4041
return new UndefinedMethodException($message, $exception);
4142
}
4243

@@ -56,6 +57,7 @@ public function handleError(array $error, FatalErrorException $exception)
5657
} else {
5758
$candidates = '"'.$last;
5859
}
60+
5961
$message .= "\nDid you mean to call ".$candidates;
6062
}
6163

0 commit comments

Comments
 (0)