Passed
Push — task/question-descriptions-opt... ( ce2668 )
by Grant
17:51 queued 08:44
created

SkillComposer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 8 2
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use Illuminate\View\View;
6
use Illuminate\Support\Facades\Lang;
7
use App\Models\Lookup\SkillLevel;
8
9
class SkillComposer
10
{
11
    /**
12
     * @var mixed $skillLevels
13
     */
14
    private $skillLevels;
15
16
    /**
17
     * Bind data to the view.
18
     *
19
     * @param View $view View being rendered.
20
     *
21
     * @return void
22
     */
23 6
    public function compose(View $view) : void
24
    {
25 6
        if (!$this->skillLevels) {
26 6
            $this->skillLevels = SkillLevel::all();
27
        }
28
29 6
        $view->with('skill_levels', $this->skillLevels);
30 6
        $view->with('skill_template', Lang::get('common/skills'));
31 6
    }
32
}
33