Passed
Pull Request — master (#721)
by Florian
09:26
created

Modal   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 29
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, $title, $size, $centered;
10
    public $index;
11
12
    public function __construct(
13
        $title, $size = null, $id, 
14
        $centered = true, $index = 1)
15
    {
16
        $this->id = $id;
17
        $this->title = $title;
18
        $this->centered = $centered;
19
        $this->size = $size;
20
        $this->index = $index;
21
    }
22
23
    public function modalsize()
24
    {
25
        return !is_null($this->size) ? 'modal-'.$this->size : '';
26
    }
27
28
    public function zindex()
29
    {
30
        return $this->index * 1050;
31
    }
32
33
    public function render()
34
    {
35
        return view('adminlte::modal');
36
    }
37
}