1 | <?php |
||
12 | final class TestimonyObserver |
||
13 | { |
||
14 | use FileTraits; |
||
15 | |||
16 | /** |
||
17 | * Handle the testimony "created" event. |
||
18 | * |
||
19 | * @param \Faithgen\Testimonies\Models\Testimony $testimony |
||
20 | * @return void |
||
21 | */ |
||
22 | public function created(Testimony $testimony) |
||
31 | |||
32 | /** |
||
33 | * Handle the testimony "updated" event. |
||
34 | * |
||
35 | * @param \Faithgen\Testimonies\Models\Testimony $testimony |
||
36 | * @return void |
||
37 | */ |
||
38 | public function updated(Testimony $testimony) |
||
42 | |||
43 | /** |
||
44 | * Handle the testimony "deleted" event. |
||
45 | * |
||
46 | * @param \Faithgen\Testimonies\Models\Testimony $testimony |
||
47 | * @return void |
||
48 | */ |
||
49 | public function deleted(Testimony $testimony) |
||
58 | } |
||
59 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: