DJsViewComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 7 2
1
<?php
2
3
namespace WITR\ViewComposers;
4
5
use WITR\DJ;
6
use Illuminate\View\View;
7
8
class DJsViewComposer {
9
10
    protected $djs;
11
12
	/**
13
	 * Bind data to the view.
14
	 *
15
	 * @param  View  $view
16
	 * @return void
17
	 */
18
	public function compose(View $view)
19
    {
20
        if ($this->djs == null) {
21
            $this->djs = DJ::orderBy('name', 'asc')->get();
22
        }
23
		$view->with('djs', $this->djs);
24
	}
25
}
26