1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace EventSauce\EventSourcing; |
||
6 | |||
7 | final class SynchronousMessageDispatcher implements MessageDispatcher |
||
8 | { |
||
9 | /** |
||
10 | * @var list<MessageConsumer> |
||
11 | */ |
||
12 | private array $consumers; |
||
13 | |||
14 | 20 | public function __construct(MessageConsumer ...$consumers) |
|
15 | { |
||
16 | 20 | $this->consumers = $consumers; |
|
0 ignored issues
–
show
|
|||
17 | 20 | } |
|
18 | |||
19 | 12 | public function dispatch(Message ...$messages): void |
|
20 | { |
||
21 | 12 | foreach ($messages as $message) { |
|
22 | 12 | foreach ($this->consumers as $consumer) { |
|
23 | 11 | $consumer->handle($message); |
|
24 | } |
||
25 | } |
||
26 | 12 | } |
|
27 | } |
||
28 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..