mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: revert higher order message property
This commit is contained in:
@ -55,7 +55,9 @@ final class HigherOrderMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return Reflection::call($target, $this->name, is_array($this->arguments) ? $this->arguments : []);
|
return is_array($this->arguments)
|
||||||
|
? Reflection::call($target, $this->name, $this->arguments)
|
||||||
|
: $target->{$this->name}; /* @phpstan-ignore-line */
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
Reflection::setPropertyValue($throwable, 'file', $this->filename);
|
Reflection::setPropertyValue($throwable, 'file', $this->filename);
|
||||||
Reflection::setPropertyValue($throwable, 'line', $this->line);
|
Reflection::setPropertyValue($throwable, 'line', $this->line);
|
||||||
|
|||||||
@ -7,7 +7,7 @@ test('undefined method exceptions', function () {
|
|||||||
__FILE__,
|
__FILE__,
|
||||||
1,
|
1,
|
||||||
'foqwdqwd',
|
'foqwdqwd',
|
||||||
null
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(fn () => $message->call($this))->toThrow(function (ReflectionException $exception) {
|
expect(fn () => $message->call($this))->toThrow(function (ReflectionException $exception) {
|
||||||
|
|||||||
Reference in New Issue
Block a user