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