mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Merge branch 'master' into better-dataset-support
This commit is contained in:
@ -38,6 +38,10 @@ final class HigherOrderMessage
|
||||
|
||||
/**
|
||||
* Re-throws the given `$throwable` with the good line and filename.
|
||||
*
|
||||
* @template TValue of object
|
||||
*
|
||||
* @param TValue $target
|
||||
*/
|
||||
public function call(object $target): mixed
|
||||
{
|
||||
@ -59,7 +63,7 @@ final class HigherOrderMessage
|
||||
Reflection::setPropertyValue($throwable, 'line', $this->line);
|
||||
|
||||
if ($throwable->getMessage() === self::getUndefinedMethodMessage($target, $this->name)) {
|
||||
/** @var ReflectionClass $reflection */
|
||||
/** @var ReflectionClass<TValue> $reflection */
|
||||
$reflection = new ReflectionClass($target);
|
||||
/* @phpstan-ignore-next-line */
|
||||
$reflection = $reflection->getParentClass() ?: $reflection;
|
||||
|
||||
@ -118,11 +118,14 @@ final class Reflection
|
||||
/**
|
||||
* Sets the property value of the given object.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @template TValue of object
|
||||
*
|
||||
* @param TValue $object
|
||||
* @param mixed $value
|
||||
*/
|
||||
public static function setPropertyValue(object $object, string $property, $value): void
|
||||
{
|
||||
/** @var ReflectionClass $reflectionClass */
|
||||
/** @var ReflectionClass<TValue> $reflectionClass */
|
||||
$reflectionClass = new ReflectionClass($object);
|
||||
|
||||
$reflectionProperty = null;
|
||||
|
||||
Reference in New Issue
Block a user