feat(pending-higher-order-tests): adds code and tests

This commit is contained in:
Nuno Maduro
2020-06-04 01:34:03 +02:00
parent c81dce0f6d
commit aa1917c28d
6 changed files with 103 additions and 26 deletions

View File

@ -78,7 +78,9 @@ final class HigherOrderMessage
if ($throwable->getMessage() === sprintf(self::UNDEFINED_METHOD, $this->methodName)) {
/** @var \ReflectionClass $reflection */
$reflection = (new ReflectionClass($target))->getParentClass();
$reflection = new ReflectionClass($target);
/* @phpstan-ignore-next-line */
$reflection = $reflection->getParentClass() ?: $reflection;
Reflection::setPropertyValue($throwable, 'message', sprintf('Call to undefined method %s::%s()', $reflection->getName(), $this->methodName));
}