1 | <?php |
||
8 | class FakeAggregateRoot |
||
9 | { |
||
10 | /** @var \Spatie\EventProjector\AggregateRoot */ |
||
11 | private $aggregateRoot; |
||
12 | |||
13 | public function __construct(AggregateRoot $aggregateRoot) |
||
17 | |||
18 | /** |
||
19 | * @param \Spatie\EventProjector\ShouldBeStored|\Spatie\EventProjector\ShouldBeStored[] $events |
||
20 | * |
||
21 | * @return $this |
||
22 | */ |
||
23 | public function given($events) |
||
35 | |||
36 | public function when($callable) |
||
42 | |||
43 | public function assertNothingRecorded() |
||
49 | |||
50 | /** |
||
51 | * @param \Spatie\EventProjector\ShouldBeStored|\Spatie\EventProjector\ShouldBeStored[] $expectedEvents |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function assertRecorded($expectedEvents) |
||
63 | |||
64 | public function assertNotRecorded($unexpectedEventClasses): void |
||
76 | |||
77 | public function __call($name, $arguments) |
||
83 | } |
||
84 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: