Completed
Push — master ( b5f959...da0e5f )
by Costin
02:20
created

Submit::attributesList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SoareCostin\BladeFormComponents\FormElements;
4
5
use SoareCostin\BladeFormComponents\FormElement;
6
7
class Submit extends FormElement
8
{
9
    protected function attributesList()
10
    {
11
        return [
12
            'class', 'disabled',
13
        ];
14
    }
15
16
    protected function setLabel()
17
    {
18
        parent::setLabel();
19
20
        if (is_null($this->label)) {
0 ignored issues
show
introduced by
The condition is_null($this->label) is always false.
Loading history...
21
            $this->label = is_null($this->model) ? 'Create' : 'Edit';
22
        }
23
    }
24
25
    protected function setDefaultClass()
26
    {
27
        // Specific to Bootstrap, we need to add it to config
28
        $this->class[] = 'btn btn-primary';
29
    }
30
}
31