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

InfoBox   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
A background() 0 3 3
A foreground() 0 3 3
A render() 0 3 1
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class InfoBox extends Component
8
{
9
    public $bg;
10
    public $icon;
11
    public $title;
12
    public $text;
13
    public $full;
14
    public $grad;
15
    public $id;
16
    public $progress;
17
    public $comment;
18
19
    public function __construct(
20
        $bg = 'info', $icon = 'fas fa-star', $id = null,
21
        $title, $text, $full = false, $grad = false,
22
        $progress = false, $comment = false)
23
    {
24
        $this->id = $id;
25
        $this->bg = $bg;
26
        $this->icon = $icon;
27
        $this->title = $title;
28
        $this->text = $text;
29
        $this->full = $full;
30
        $this->grad = $grad;
31
        $this->progress = $progress;
32
        $this->comment = $comment;
33
    }
34
35
    public function background()
36
    {
37
        return $this->full ? ($this->grad ? 'bg-gradient-' : 'bg-').$this->bg : '';
38
    }
39
40
    public function foreground()
41
    {
42
        return ! $this->full ? ($this->grad ? 'bg-gradient-' : 'bg-').$this->bg : '';
43
    }
44
45
    public function render()
46
    {
47
        return view('adminlte::components.info-box');
48
    }
49
}
50