| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Cviebrock\EloquentSluggable\Middleware; |
||
| 19 | public function handle(Request $request, \Closure $next) |
||
| 20 | { |
||
| 21 | $route = $request->route(); |
||
| 22 | if ($oldSlug = $this->findOldSlug($route->parameter('slug'))) { |
||
| 23 | $currentSlug = $this->findSlugFrom($oldSlug); |
||
| 24 | $path = $this->routeGenerator($request)->to( |
||
| 25 | $request->route(), |
||
|
|
|||
| 26 | array_merge($route->parameters(), ['slug' => $currentSlug]) |
||
| 27 | ); |
||
| 28 | |||
| 29 | return new RedirectResponse($path); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $next($request); |
||
| 33 | } |
||
| 34 | |||
| 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: