Passed
Pull Request — master (#721)
by Florian
09:26
created

InfoBox::foreground()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 1
c 1
b 0
f 0
nc 4
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class InfoBox extends Component
8
{
9
    public $bg, $icon, $title, $text, $full, $grad;
10
    public $id, $progress, $comment;
11
12
    public function __construct(
13
        $bg = 'info', $icon = 'fas fa-star', $id = null,
14
        $title, $text, $full = false, $grad = false,
15
        $progress = false, $comment = false)
16
    {
17
        $this->id = $id;
18
        $this->bg = $bg;
19
        $this->icon = $icon;
20
        $this->title = $title;
21
        $this->text = $text;
22
        $this->full = $full;
23
        $this->grad = $grad;
24
        $this->progress = $progress;
25
        $this->comment = $comment;
26
    }
27
28
    public function background()
29
    {
30
        return $this->full ?  ($this->grad ? 'bg-gradient-' : 'bg-').$this->bg : '';
31
    }
32
33
    public function foreground()
34
    {
35
        return !$this->full ?  ($this->grad ? 'bg-gradient-' : 'bg-').$this->bg : '';
36
    }
37
38
    public function render()
39
    {
40
        return view('adminlte::info-box');
41
    }
42
}
43