Passed
Push — feature/application-review-ui ( afbf92 )
by Chris
06:55
created

AuthController::auth_routes()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 37
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 25
dl 0
loc 37
rs 9.52
c 0
b 0
f 0
cc 3
nc 3
nop 0
1
<?php
2
3
namespace App\Http\Controllers\Auth;
4
5
use App\Http\Controllers\Controller;
6
use Facades\App\Services\WhichPortal;
7
8
class AuthController extends Controller
9
{
10
    /**
11
     * Sets the route namespace based on the logged in user.
12
     *
13
     * @return mixed[]
14
     */
15
    protected function auth_routes() //phpcs:ignore
16
    {
17
        if (WhichPortal::isManagerPortal()) {
18
            $routes = [
19
                'home' => route('manager.home'),
0 ignored issues
show
Bug introduced by
The function route was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
                'home' => /** @scrutinizer ignore-call */ route('manager.home'),
Loading history...
20
                'login' => route('manager.login'),
21
                'register' => route('manager.register'),
22
                'password' => [
23
                    'email' => route('manager.password.email'),
24
                    'request' => route('manager.password.request'),
25
                ],
26
                // 'passwords.reset' => route('manager.password.reset'),
27
            ];
28
        } elseif (WhichPortal::isHrPortal()) {
29
            $routes = [
30
                'home' => route('hr_advisor.home'),
31
                'login' => route('hr_advisor.login'),
32
                'register' => route('hr_advisor.register'),
33
                'password' => [
34
                    'email' => route('hr_advisor.password.email'),
35
                    'request' => route('hr_advisor.password.request'),
36
                ],
37
                // 'passwords.reset' => route('hr_advisor.password.reset'),
38
            ];
39
        } else {
40
            $routes = [
41
                'home' => route('home'),
42
                'login' => route('login'),
43
                'register' => route('register'),
44
                'password' => [
45
                    'email' => route('password.email'),
46
                    'request' => route('password.request'),
47
                ],
48
                // 'passwords.reset' => route('password.reset'),
49
            ];
50
        }
51
        return $routes;
52
    }
53
}
54