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

Modal   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 14
c 2
b 1
f 0
dl 0
loc 32
ccs 13
cts 13
cp 1
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A render() 0 3 1
A modalsize() 0 3 2
A zindex() 0 3 1
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class Modal extends Component
8
{
9
    public $id;
10
    public $title;
11
    public $size;
12
    public $centered;
13
    public $index;
14
15 2
    public function __construct(
16
        $title, $size = null, $id,
17
        $centered = true, $index = 1)
18
    {
19 2
        $this->id = $id;
20 2
        $this->title = $title;
21 2
        $this->centered = $centered;
22 2
        $this->size = $size;
23 2
        $this->index = $index;
24 2
    }
25
26 1
    public function modalsize()
27
    {
28 1
        return ! is_null($this->size) ? 'modal-'.$this->size : '';
29
    }
30
31 1
    public function zindex()
32
    {
33 1
        return $this->index * 1050;
34
    }
35
36 1
    public function render()
37
    {
38 1
        return view('adminlte::components.modal');
39
    }
40
}
41