Completed
Push — master ( 6e8c16...bdc137 )
by wen
03:38
created

RedirectIfAuthenticated   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace Sco\Admin\Middleware;
4
5
use Auth;
6
use Closure;
7
use Illuminate\Http\Request;
8
9
class RedirectIfAuthenticated
10
{
11
    /**
12
     * Handle an incoming request.
13
     *
14
     * @param \Illuminate\Http\Request $request
15
     * @param \Closure                 $next
16
     * @param string|null              $guard
17
     *
18
     * @return mixed
19
     */
20
    public function handle(Request $request, Closure $next, $guard = null)
0 ignored issues
show
Unused Code introduced by
The parameter $guard is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22
        if (Auth::guard(config('admin.guard'))->check()) {
23
            return redirect()->route('admin.index');
24
        }
25
26
        return $next($request);
27
    }
28
}
29