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

SmallBox   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
c 1
b 0
f 0
dl 0
loc 34
ccs 0
cts 14
cp 0
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
    public function __construct(
19
        $bg = 'info', $icon = 'fas fa-star', $title, $id = null,
20
        $text, $url = '#', $urlText = null,
21
        $loading = false)
22
    {
23
        $this->id = $id;
24
        $this->bg = $bg;
25
        $this->icon = $icon;
26
        $this->title = $title;
27
        $this->text = $text;
28
        $this->url = $url;
29
        $this->urlText = $urlText;
30
        $this->loading = $loading;
31
    }
32
33
    public function urlTextLine()
34
    {
35
        return ($this->urlText == null) ? 'More Info' : $this->urlText;
36
    }
37
38
    public function render()
39
    {
40
        return view('adminlte::small-box');
41
    }
42
}
43