1 | <?php |
||
13 | abstract class DomainEvent implements DomainEventInterface |
||
14 | { |
||
15 | /** @var AggregateIdInterface */ |
||
16 | private $aggregateId; |
||
17 | |||
18 | /** @var AggregateRevision */ |
||
19 | private $aggregateRevision; |
||
20 | |||
21 | 7 | public function getAggregateId(): AggregateIdInterface |
|
25 | |||
26 | 3 | public function getAggregateRevision(): AggregateRevision |
|
30 | |||
31 | 3 | public function withAggregateRevision(AggregateRevision $aggregateRevision): DomainEventInterface |
|
37 | |||
38 | 2 | public function toArray(): array |
|
39 | { |
||
40 | return [ |
||
41 | 2 | 'aggregateId' => $this->aggregateId->toNative(), |
|
42 | 2 | 'aggregateRevision' => $this->aggregateRevision->toNative() |
|
43 | ]; |
||
44 | } |
||
45 | |||
46 | 8 | protected function __construct(AggregateIdInterface $aggregateId, AggregateRevision $aggregateRevision = null) |
|
51 | } |
||
52 |
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.