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

Modal::modalsize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 2
eloc 1
c 2
b 1
f 0
nc 2
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 6
rs 10
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
    public function __construct(
16
        $title, $size = null, $id,
17
        $centered = true, $index = 1)
18
    {
19
        $this->id = $id;
20
        $this->title = $title;
21
        $this->centered = $centered;
22
        $this->size = $size;
23
        $this->index = $index;
24
    }
25
26
    public function modalsize()
27
    {
28
        return ! is_null($this->size) ? 'modal-'.$this->size : '';
29
    }
30
31
    public function zindex()
32
    {
33
        return $this->index * 1050;
34
    }
35
36
    public function render()
37
    {
38
        return view('adminlte::components.modal');
39
    }
40
}
41