1 | <?php namespace Cviebrock\EloquentSluggable; |
||
12 | class SluggableObserver |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * @var \Cviebrock\EloquentSluggable\Services\SlugService |
||
17 | */ |
||
18 | private $slugService; |
||
19 | |||
20 | /** |
||
21 | * @var \Illuminate\Contracts\Events\Dispatcher |
||
22 | */ |
||
23 | private $events; |
||
24 | |||
25 | /** |
||
26 | * SluggableObserver constructor. |
||
27 | * |
||
28 | * @param \Cviebrock\EloquentSluggable\Services\SlugService $slugService |
||
29 | * @param \Illuminate\Contracts\Events\Dispatcher $events |
||
30 | */ |
||
31 | public function __construct(SlugService $slugService, Dispatcher $events) |
||
36 | |||
37 | /** |
||
38 | * @param \Illuminate\Database\Eloquent\Model $model |
||
39 | * @return bool|void |
||
40 | */ |
||
41 | public function saved(Model $model) |
||
47 | |||
48 | /** |
||
49 | * @param \Illuminate\Database\Eloquent\Model $model |
||
50 | * @param string $event |
||
51 | * @return boolean |
||
52 | */ |
||
53 | protected function generateSlug(Model $model, string $event): bool |
||
65 | |||
66 | /** |
||
67 | * Fire the namespaced validating event. |
||
68 | * |
||
69 | * @param \Illuminate\Database\Eloquent\Model $model |
||
70 | * @param string $event |
||
71 | * @return array|null |
||
72 | */ |
||
73 | protected function fireSluggingEvent(Model $model, string $event): ?array |
||
77 | |||
78 | /** |
||
79 | * Fire the namespaced post-validation event. |
||
80 | * |
||
81 | * @param \Illuminate\Database\Eloquent\Model $model |
||
82 | * @param string $status |
||
83 | * @return void |
||
84 | */ |
||
85 | protected function fireSluggedEvent(Model $model, string $status): void |
||
89 | } |
||
90 |
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: