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

GetEquipmentData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAllEquipmentNoCat() 0 11 2
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