1 | <?php namespace Cviebrock\EloquentSluggable; |
||
7 | class SluggableObserver |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var \Cviebrock\EloquentSluggable\Services\SlugService |
||
12 | */ |
||
13 | private $slugService; |
||
14 | |||
15 | /** |
||
16 | * @var \Illuminate\Contracts\Events\Dispatcher |
||
17 | */ |
||
18 | private $events; |
||
19 | |||
20 | /** |
||
21 | * SluggableObserver constructor. |
||
22 | * |
||
23 | * @param \Cviebrock\EloquentSluggable\Services\SlugService $slugService |
||
24 | * @param \Illuminate\Contracts\Events\Dispatcher $events |
||
25 | */ |
||
26 | public function __construct(SlugService $slugService, Dispatcher $events) |
||
31 | |||
32 | /** |
||
33 | * @param \Illuminate\Database\Eloquent\Model $model |
||
34 | * @return boolean|null |
||
35 | */ |
||
36 | public function saving(Model $model) |
||
40 | |||
41 | /** |
||
42 | * @param \Illuminate\Database\Eloquent\Model $model |
||
43 | * @param string $event |
||
44 | * @return boolean|null |
||
45 | */ |
||
46 | protected function generateSlug(Model $model, $event) |
||
56 | |||
57 | /** |
||
58 | * Fire the namespaced validating event. |
||
59 | * |
||
60 | * @param \Illuminate\Database\Eloquent\Model $model |
||
61 | * @param string $event |
||
62 | * @return mixed |
||
63 | */ |
||
64 | protected function fireSluggingEvent(Model $model, $event) |
||
68 | |||
69 | /** |
||
70 | * Fire the namespaced post-validation event. |
||
71 | * |
||
72 | * @param \Illuminate\Database\Eloquent\Model $model |
||
73 | * @param string $status |
||
74 | * @return void |
||
75 | */ |
||
76 | protected function fireSluggedEvent(Model $model, $status) |
||
80 | } |
||
81 |
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: