LaravelUnusedMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
1
<?php
2
3
namespace TypeHints\Unused\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
8
class LaravelUnusedMiddleware
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param Request $request
14
     * @param Closure $next
15
     *
16
     * @return mixed
17
     */
18
    public function handle($request, Closure $next)
19
    {
20
        if (!app('config')->get('app.debug')) {
0 ignored issues
show
Bug introduced by
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 ignore-call  annotation

20
        if (!/** @scrutinizer ignore-call */ app('config')->get('app.debug')) {
Loading history...
21
            abort(404);
0 ignored issues
show
Bug introduced by
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 ignore-call  annotation

21
            /** @scrutinizer ignore-call */ 
22
            abort(404);
Loading history...
22
        }
23
24
        return $next($request);
25
    }
26
}
27