Passed
Push — release/1.0.17 ( f9f3c1...f9f3c1 )
by Grant
10:46 queued 13s
created

OneTimePasswordComposer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 12 3
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use Illuminate\View\View;
6
use Illuminate\Support\Facades\Lang;
7
use Facades\App\Services\WhichPortal;
8
9
class OneTimePasswordComposer
10
{
11
    /**
12
     * Bind data to the view.
13
     *
14
     * @param  View  $view
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...
15
     * @return void
16
     */
17
    public function compose(View $view)
18
    {
19
        if (WhichPortal::isManagerPortal()) {
20
            $logout_link = route('manager.logout');
21
        } elseif (WhichPortal::isAdminPortal()) {
22
            $logout_link = backpack_url('logout');
23
        } else {
24
            $logout_link = route('logout');
25
        }
26
        $view->with('otp', Lang::get('one_time_password'))
27
            ->with([
28
                'logout_link' => $logout_link,
29
            ]);
30
    }
31
}
32