Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 591b2ca

Browse filesBrowse files
committed
Update after review.
1 parent 0947105 commit 591b2ca
Copy full SHA for 591b2ca

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
+3-1Lines changed: 3 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.