Passed
Push — dev5a ( f24c41...668142 )
by Ron
10:56
created

GetEquipment::getAllEquipment()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 12
ccs 5
cts 5
cp 1
crap 2
rs 10
1
<?php
2
3
namespace App\Domains\Equipment;
4
5
use App\SystemCategories;
6
use App\SystemTypes;
7
use Illuminate\Support\Facades\Auth;
8
use Illuminate\Support\Facades\Log;
9
10
11
class GetEquipment
12
{
13 6
    public function getAllEquipment($incCat = false)
14
    {
15 6
        if($incCat)
16
        {
17 4
            $list = SystemCategories::with('SystemTypes')->get();
18
        }
19
        else
20
        {
21 2
            $list = SystemTypes::all();
22
        }
23
24 6
        return $list;
25
    }
26
}
27