RedirectIfInstalled   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
7
class RedirectIfInstalled
8
{
9
    const INSTALLATION_FILE = 'install.lock';
10
11
    /**
12
     * Handle an incoming request.
13
     *
14
     * @param  \Illuminate\Http\Request $request
15
     * @param  \Closure $next
16
     * @return mixed
17
     */
18
    public function handle($request, Closure $next)
19
    {
20
        // Installation lock disabled, we can't run the install process anymore
21
        if (!file_exists(base_path() . '/' . self::INSTALLATION_FILE)) {
22
            return redirect('/');
23
        }
24
25
        return $next($request);
26
    }
27
}
28