Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | final class MessageDispatcher implements MessageDispatcherInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var Bus |
||
16 | */ |
||
17 | private $bus; |
||
18 | |||
19 | 4 | public function __construct(BusInterface $bus) |
|
20 | { |
||
21 | 4 | $this->bus = $bus; |
|
|
|||
22 | 4 | } |
|
23 | |||
24 | 2 | public function dispatchSynchronousMessage( |
|
25 | $payload, |
||
26 | string $destination, |
||
27 | array $metadataCollection = [] |
||
28 | ): void { |
||
29 | 2 | $this->bus->deliver(new Message($payload, $destination, $metadataCollection)); |
|
30 | 2 | } |
|
31 | |||
32 | 2 | public function dispatchQueuedMessage( |
|
40 | 2 | } |
|
41 | } |
||
42 |
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.