StaticLabel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 8 3
A yesNo() 0 8 1
1
<?php namespace Distilleries\FormBuilder\Helpers;
2
3
class StaticLabel {
4
5
    const STATUS_OFFLINE = 0;
6
    const STATUS_ONLINE = 1;
7
8 30
    public static function yesNo($id = null)
9
    {
10
        $items = [
11 30
            self::STATUS_OFFLINE => trans('form-builder::form.no'),
12 30
            self::STATUS_ONLINE  => trans('form-builder::form.yes'),
13
        ];
14
15 30
        return self::getLabel($items, $id);
16
17
    }
18
19 30
    public static function getLabel($items, $id = null)
20
    {
21 30
        if (isset($id))
22
        {
23 8
            return isset($items[$id]) ? $items[$id] : trans('form-builder::form.na');
24
        }
25
26 24
        return $items;
27
    }
28
}