fomvasss /
laravel-url-aliases
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace Fomvasss\UrlAliases\Middleware; |
||||||
| 4 | |||||||
| 5 | use Closure; |
||||||
| 6 | |||||||
| 7 | class ApplyUrlLocaleToRootPage |
||||||
| 8 | { |
||||||
| 9 | protected $app; |
||||||
| 10 | |||||||
| 11 | protected $config; |
||||||
| 12 | /** |
||||||
| 13 | * Handle an incoming request. |
||||||
| 14 | * |
||||||
| 15 | * @param \Illuminate\Http\Request $request |
||||||
|
0 ignored issues
–
show
|
|||||||
| 16 | * @param \Closure $next |
||||||
| 17 | * @return mixed |
||||||
| 18 | */ |
||||||
| 19 | public function handle($request, Closure $next) |
||||||
| 20 | { |
||||||
| 21 | $this->app = app(); |
||||||
|
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 22 | $this->config = $this->app['config']; |
||||||
| 23 | |||||||
| 24 | $supportedLocales = $this->config->get('url-aliases-laravellocalization.supportedLocales'); |
||||||
| 25 | |||||||
| 26 | if (empty($request->segment(1)) || count($request->segments()) == 1 && in_array($request->segment(1), array_keys($supportedLocales))) { |
||||||
| 27 | return $next($request); |
||||||
| 28 | } |
||||||
| 29 | |||||||
| 30 | abort(404); |
||||||
|
0 ignored issues
–
show
The function
abort was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 31 | } |
||||||
| 32 | } |
||||||
| 33 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths