Callout   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 69
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A makeCalloutClass() 0 9 2
A __construct() 0 7 1
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\View\Components\Widget;
4
5
use Illuminate\View\Component;
6
use JeroenNoten\LaravelAdminLte\Helpers\UtilsHelper;
7
8
class Callout extends Component
9
{
10
    /**
11
     * The callout icon (a Font Awesome icon).
12
     *
13
     * @var string
14
     */
15
    public $icon;
16
17
    /**
18
     * The callout theme (info, success, warning or danger).
19
     *
20
     * @var string
21
     */
22
    public $theme;
23
24
    /**
25
     * The callout title.
26
     *
27
     * @var string
28
     */
29
    public $title;
30
31
    /**
32
     * Extra classes for the title container. This provides a way to customize
33
     * the title style.
34
     *
35
     * @var string
36
     */
37
    public $titleClass;
38
39
    /**
40
     * Create a new component instance.
41
     *
42
     * @return void
43
     */
44 2
    public function __construct(
45
        $theme = null, $icon = null, $title = null, $titleClass = null
46
    ) {
47 2
        $this->theme = $theme;
48 2
        $this->icon = $icon;
49 2
        $this->title = UtilsHelper::applyHtmlEntityDecoder($title);
50 2
        $this->titleClass = $titleClass;
51
    }
52
53
    /**
54
     * Make the class attribute for the callout item.
55
     *
56
     * @return string
57
     */
58 1
    public function makeCalloutClass()
59
    {
60 1
        $classes = ['callout'];
61
62 1
        if (! empty($this->theme)) {
63 1
            $classes[] = "callout-{$this->theme}";
64
        }
65
66 1
        return implode(' ', $classes);
67
    }
68
69
    /**
70
     * Get the view / contents that represent the component.
71
     *
72
     * @return \Illuminate\View\View|string
73
     */
74 1
    public function render()
75
    {
76 1
        return view('adminlte::components.widget.callout');
77
    }
78
}
79