| 1 | <?php |
||
| 11 | class MiniGameEventSourcedRepository implements GameRepository |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var EventSourcingRepository |
||
| 15 | */ |
||
| 16 | private $repository; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Constructor |
||
| 20 | * |
||
| 21 | * @param EventSourcingRepository $repository |
||
| 22 | */ |
||
| 23 | public function __construct(EventSourcingRepository $repository) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Saves a mini-game |
||
| 30 | * |
||
| 31 | * @param MiniGame $game |
||
| 32 | * @return MiniGame |
||
| 33 | */ |
||
| 34 | public function save(MiniGame $game) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the mini-game corresponding to the id |
||
| 41 | * |
||
| 42 | * @param MiniGameId $id |
||
| 43 | * @throws GameNotFoundException |
||
| 44 | * @return MiniGame |
||
| 45 | */ |
||
| 46 | public function load(MiniGameId $id) |
||
| 50 | } |
||
| 51 |
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: