Skip to content

Commit 48f18b3

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Use createMock() instead of a getter [ErrorHandler] Fix strpos error when trying to call a method without a name use proper keys to not override appended files Fix console logger according to PSR-3
2 parents 4fd4a37 + 1812657 commit 48f18b3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ErrorEnhancer/UndefinedMethodErrorEnhancer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function enhance(\Throwable $error): ?\Throwable
3939

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

42-
if (!class_exists($className) || null === $methods = get_class_methods($className)) {
42+
if ('' === $methodName || !class_exists($className) || null === $methods = get_class_methods($className)) {
4343
// failed to get the class or its methods on which an unknown method was called (for example on an anonymous class)
4444
return new UndefinedMethodError($message, $error);
4545
}

Tests/ErrorEnhancer/UndefinedMethodErrorEnhancerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function provideUndefinedMethodData()
4040
'Call to undefined method SplObjectStorage::what()',
4141
'Attempted to call an undefined method named "what" of class "SplObjectStorage".',
4242
],
43+
[
44+
'Call to undefined method SplObjectStorage::()',
45+
'Attempted to call an undefined method named "" of class "SplObjectStorage".',
46+
],
4347
[
4448
'Call to undefined method SplObjectStorage::walid()',
4549
"Attempted to call an undefined method named \"walid\" of class \"SplObjectStorage\".\nDid you mean to call \"valid\"?",

0 commit comments

Comments
 (0)