Passed
Pull Request — master (#721)
by Florian
02:40
created

Progress::barsize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 2
eloc 1
c 2
b 1
f 0
nc 2
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 6
rs 10
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class Progress extends Component
8
{
9
    public $size;
10
    public $bg;
11
    public $stripped;
12
    public $vertical;
13
    public $value;
14
15
    public function __construct(
16
        $size = null, $bg = 'info',
17
        $value, $stripped = false, $vertical = false)
18
    {
19
        $this->bg = $bg;
20
        $this->size = $size;
21
        $this->value = $value;
22
        $this->stripped = $stripped;
23
        $this->vertical = $vertical;
24
    }
25
26
    public function barsize()
27
    {
28
        return ! is_null($this->size) ? 'progress-'.$this->size : null;
29
    }
30
31
    public function render()
32
    {
33
        return view('adminlte::components.progress');
34
    }
35
}
36