Passed
Push — dev5 ( c3531a...a24f56 )
by Ron
08:14
created

GetEquipmentData::getAllEquipmentNoCat()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

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 11
ccs 5
cts 6
cp 0.8333
crap 2.0185
rs 10
1
<?php
2
3
namespace App\Domains\Equipment;
4
5
use Illuminate\Support\Facades\Log;
6
use Illuminate\Support\Facades\Auth;
7
8
use App\SystemTypes;
9
use App\Http\Resources\SystemTypesCollection;
10
11
12
class GetEquipmentData
13
{
14
    //  Get a list of all equipment, but exclude the category name
15 2
    public function getAllEquipmentNoCat($collection = false)
16
    {
17 2
        $sysList = SystemTypes::orderBy('cat_id', 'ASC')->orderBy('name', 'ASC')->get();
18 2
        Log::debug('Equipment list gathered without category list.  Data Gathered - ', array($sysList));
19
20 2
        if($collection)
21
        {
22 2
            return new SystemTypesCollection($sysList);
23
        }
24
25
        return $sysList;
26
    }
27
}
28