Passed
Push — master ( 6ceee8...d4902a )
by Tristan
20:51 queued 08:57
created

DemoNotificationComposer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
c 0
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 6 2
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use Illuminate\View\View;
6
use Illuminate\Support\Facades\Lang;
7
use Illuminate\Support\Facades\Auth;
8
9
class DemoNotificationComposer
10
{
11
    /**
12
     * Bind data to the view.
13
     *
14
     * @param  View  $view
15
     * @return void
16
     */
17
    public function compose(View $view)
18
    {
19
        $show_demo_notification = Auth::user() !== null && Auth::user()->isDemoManager();
20
        $view->with([
21
            'notification' => Lang::get('manager/notification'),
22
            'show_demo_notification' => $show_demo_notification,
23
        ]);
24
    }
25
}
26