IgnitionEnabled   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
A ignitionEnabled() 0 4 1
1
<?php
2
3
namespace Facade\Ignition\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
8
class IgnitionEnabled
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  Request  $request
14
     * @param  Closure  $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
        if (! $this->ignitionEnabled()) {
20
            abort(404);
21
        }
22
23
        return $next($request);
24
    }
25
26
    protected function ignitionEnabled(): bool
27
    {
28
        return config('app.debug');
29
    }
30
}
31