1 | <?php |
||
13 | abstract class Command implements CommandInterface |
||
14 | { |
||
15 | /** @var AggregateIdInterface */ |
||
16 | private $aggregateId; |
||
17 | |||
18 | /** @var AggregateRevision */ |
||
19 | private $knownAggregateRevision; |
||
20 | |||
21 | 4 | public function getAggregateId(): AggregateIdInterface |
|
25 | |||
26 | 1 | public function getKnownAggregateRevision(): AggregateRevision |
|
27 | { |
||
28 | 1 | return $this->knownAggregateRevision; |
|
29 | } |
||
30 | |||
31 | public function hasKnownAggregateRevision(): bool |
||
35 | |||
36 | 1 | public function toArray(): array |
|
37 | { |
||
38 | return [ |
||
39 | 1 | 'aggregateId' => $this->aggregateId->toNative(), |
|
40 | 1 | 'knownAggregateRevision' => $this->knownAggregateRevision->toNative() |
|
41 | ]; |
||
42 | } |
||
43 | |||
44 | 5 | protected function __construct(AggregateIdInterface $aggregateId, AggregateRevision $knownAggregateRevision = null) |
|
49 | } |
||
50 |
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.