Passed
Push — master ( 567445...4ac224 )
by Costin
02:45
created

Submit::setStyles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
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 (empty($this->label)) {
21
            $this->label = is_null($this->model) ? 'Create' : 'Edit';
22
        }
23
    }
24
25
    protected function setStyles()
26
    {
27
        $this->class[] = config('blade-form-components.themes.'.$this->getTheme().'.fields.submit');
28
    }
29
}
30