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

SmallBox   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A urlTextLine() 0 3 2
A render() 0 3 1
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class SmallBox extends Component
8
{
9
    public $bg;
10
    public $icon;
11
    public $title;
12
    public $text;
13
    public $url;
14
    public $urlText;
15
    public $loading;
16
    public $id;
17
18 2
    public function __construct(
19
        $bg = 'info', $icon = 'fas fa-star', $title, $id = null,
20
        $text, $url = '#', $urlText = null,
21
        $loading = false)
22
    {
23 2
        $this->id = $id;
24 2
        $this->bg = $bg;
25 2
        $this->icon = $icon;
26 2
        $this->title = $title;
27 2
        $this->text = $text;
28 2
        $this->url = $url;
29 2
        $this->urlText = $urlText;
30 2
        $this->loading = $loading;
31 2
    }
32
33 1
    public function urlTextLine()
34
    {
35 1
        return ($this->urlText == null) ? 'More Info' : $this->urlText;
36
    }
37
38 1
    public function render()
39
    {
40 1
        return view('adminlte::components.small-box');
41
    }
42
}
43