ShowsViewComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
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\Show;
6
use Illuminate\View\View;
7
8
class ShowsViewComposer {
9
	
10
	protected $shows;
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->shows == null) {
21
			$this->shows = Show::orderBy('name', 'asc')->get();
22
		}
23
		$view->with('shows', $this->shows);
24
	}
25
}
26