RedirectIfAuthenticated   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
c 0
b 0
f 0
dl 0
loc 19
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
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