1 | <?php |
||
19 | trait ModelSave |
||
20 | { |
||
21 | |||
22 | /******************************************* |
||
23 | * ABSTRACTS |
||
24 | *******************************************/ |
||
25 | |||
26 | /** |
||
27 | * @param Model $model |
||
28 | * @param bool $mirrorScenario |
||
29 | * @return Record |
||
30 | */ |
||
31 | abstract public function toRecord(Model $model, bool $mirrorScenario = true): Record; |
||
32 | |||
33 | |||
34 | /******************************************* |
||
35 | * EVENT |
||
36 | *******************************************/ |
||
37 | |||
38 | /** |
||
39 | * @param Model $model |
||
40 | * @return ModelEvent |
||
41 | */ |
||
42 | protected function createEvent(Model $model): ModelEvent |
||
48 | |||
49 | /******************************************* |
||
50 | * SAVE |
||
51 | *******************************************/ |
||
52 | |||
53 | /** |
||
54 | * @param Model $model |
||
55 | * @param null $attributes |
||
56 | * @param bool $mirrorScenario |
||
57 | * @return bool |
||
58 | * @throws \Exception |
||
59 | */ |
||
60 | public function save(Model $model, $attributes = null, bool $mirrorScenario = true) |
||
135 | |||
136 | } |
||
137 |
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: