| 1 | <?php namespace Cviebrock\EloquentSluggable\Middleware; |
||
| 8 | class RedirectOnOldSlug |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Handle an incoming request. |
||
| 12 | * |
||
| 13 | * @param \Illuminate\Http\Request $request |
||
| 14 | * @param \Closure $next |
||
| 15 | * |
||
| 16 | * @return mixed |
||
| 17 | * @throws \Illuminate\Routing\Exceptions\UrlGenerationException |
||
| 18 | */ |
||
| 19 | public function handle(Request $request, \Closure $next) |
||
| 34 | |||
| 35 | private function findOldSlug($slug) |
||
| 39 | |||
| 40 | private function findSlugFrom($oldSlug) |
||
| 44 | |||
| 45 | private function routeGenerator($request) |
||
| 49 | } |
||
| 50 |
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: