| Total Complexity | 10 |
| Total Lines | 82 |
| Duplicated Lines | 0 % |
| Coverage | 88.46% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class TransientMetadata implements Property |
||
| 13 | { |
||
| 14 | /** @var ClassMetadata */ |
||
| 15 | protected $declaringClass; |
||
| 16 | |||
| 17 | /** @var ReflectionProperty */ |
||
| 18 | protected $reflection; |
||
| 19 | |||
| 20 | /** @var string */ |
||
| 21 | protected $name; |
||
| 22 | |||
| 23 | 30 | public function __construct(string $name) |
|
| 24 | { |
||
| 25 | 30 | $this->name = $name; |
|
| 26 | 30 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | 45 | public function getDeclaringClass() : ComponentMetadata |
|
| 32 | { |
||
| 33 | 45 | return $this->declaringClass; |
|
| 34 | } |
||
| 35 | |||
| 36 | 30 | public function setDeclaringClass(ComponentMetadata $declaringClass) : void |
|
| 37 | { |
||
| 38 | 30 | $this->declaringClass = $declaringClass; |
|
|
|
|||
| 39 | 30 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | 30 | public function getName() : string |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 30 | public function isPrimaryKey() : bool |
|
| 53 | { |
||
| 54 | 30 | return false; |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * {@inheritdoc} |
||
| 59 | */ |
||
| 60 | public function setValue($object, $value) : void |
||
| 61 | { |
||
| 62 | $this->reflection->setValue($object, $value); |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * {@inheritdoc} |
||
| 67 | */ |
||
| 68 | 429 | public function getValue($object) |
|
| 69 | { |
||
| 70 | 429 | return $this->reflection->getValue($object); |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * {@inheritdoc} |
||
| 75 | */ |
||
| 76 | 884 | public function setReflectionProperty(ReflectionProperty $reflectionProperty) : void |
|
| 79 | 884 | } |
|
| 80 | |||
| 81 | /** |
||
| 82 | * {@inheritdoc} |
||
| 83 | */ |
||
| 84 | 857 | public function wakeupReflection(ReflectionService $reflectionService) : void |
|
| 88 | ); |
||
| 89 | 857 | } |
|
| 90 | |||
| 91 | 29 | public function getValueGenerationExecutor(AbstractPlatform $platform) : ?ValueGenerationExecutor |
|
| 96 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.