-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\ORM\Mapping; | ||
|
||
use ReflectionProperty; | ||
|
||
final class ReflectionLazyProperty extends ReflectionProperty | ||
Check failure on line 9 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with Psalm (3.7)PropertyNotSetInConstructor
Check failure on line 9 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with Psalm (3.7)PropertyNotSetInConstructor
Check failure on line 9 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with Psalm (default)PropertyNotSetInConstructor
Check failure on line 9 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with Psalm (default)PropertyNotSetInConstructor
|
||
{ | ||
public function __construct( | ||
private readonly ReflectionProperty $wrappedProperty, | ||
) { | ||
parent::__construct($wrappedProperty->class, $wrappedProperty->name); | ||
} | ||
|
||
public function getValue(object|null $object = null): mixed | ||
{ | ||
return $this->wrappedProperty->getValue($object); | ||
} | ||
|
||
public function setValue(object|null $object, mixed $value = null): void | ||
{ | ||
if (\is_object($object)) { | ||
$r = \ReflectionLazyObject::fromInstance($object); | ||
Check failure on line 25 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with Psalm (3.7)UndefinedClass
Check failure on line 25 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with Psalm (default)UndefinedClass
Check failure on line 25 in lib/Doctrine/ORM/Mapping/ReflectionLazyProperty.php GitHub Actions / Static Analysis with PHPStan (3.7, phpstan-dbal3.neon)
|
||
|
||
if ($r) { | ||
$r->skipProperty($this->name, $this->class); | ||
} | ||
} | ||
|
||
$this->wrappedProperty->setValue($object, $value); | ||
} | ||
} |
This file was deleted.