Completed
Pull Request — master (#93)
by Marcel
01:23
created

IgnitionEnabled   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 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
27
    protected function ignitionEnabled(): bool
28
    {
29
        return config('app.debug');
30
    }
31
}