RedirectIfAuthenticated::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Contracts\Auth\Guard;
7
use Illuminate\Http\Request;
8
9
class RedirectIfAuthenticated
10
{
11
    protected $auth;
12
13
    public function __construct(Guard $auth)
14
    {
15
        $this->auth = $auth;
16
    }
17
18
    /**
19
     * @return mixed
20
     */
21
    public function handle(Request $request, Closure $next)
22
    {
23
        if ($this->auth->check()) {
24
            return redirect('/♫');
25
        }
26
27
        return $next($request);
28
    }
29
}
30