Passed
Push — task/manager-applicant-review-... ( a1a27a...d21381 )
by Xander
15:21 queued 09:20
created

Authenticate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 14
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
1
<?php
2
namespace App\Http\Middleware;
3
use Illuminate\Auth\Middleware\Authenticate as Middleware;
4
use Facades\App\Services\WhichPortal;
5
6
class Authenticate extends Middleware
7
{
8
    /**
9
    * Get the path the user should be redirected to when they are not authenticated.
10
    *
11
    * @param  \Illuminate\Http\Request  $request
2 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
12
    * @return string
13
    */
14 1
    protected function redirectTo($request)
1 ignored issue
show
introduced by
Method \App\Http\Middleware\Authenticate::redirectTo() does not have parameter type hint for its parameter $request but it should be possible to add it based on @param annotation "\Illuminate\Http\Request".
Loading history...
introduced by
Method \App\Http\Middleware\Authenticate::redirectTo() does not have return type hint for its return value but it should be possible to add it based on @return annotation "string".
Loading history...
Coding Style introduced by
Type hint "\Illuminate\Http\Request" missing for $request
Loading history...
15
    {
16 1
        if (WhichPortal::isManagerPortal()) {
17
            return route('manager.login');
18
        } else {
19 1
            return route('login');
20
        }            
21
    }
22
}
23