Completed
Push — master ( 6137a2...6b103b )
by Denis
01:30
created

Bootstrap3::setFormClasses()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 13
nc 3
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Ngtfkx\Laradeck\FormBuilder\Providers;
4
5
6
class Bootstrap3 extends AbstractProvider
7
{
8
    protected $cssFramework = 'bootstrap3';
9
10
    protected $commonClasses = 'form-control';
11
12
    public $skipCommonClassesForElements = [
13
        'button', 'checkbox', 'radio', 'submit', 'reset', 'form'
14
    ];
15
16
    protected $elementClasses = [
17
        'button' => 'btn btn-primary',
18
        'submit' => 'btn btn-primary',
19
        'reset' => 'btn btn-warning',
20
    ];
21
22
    protected function setFormClasses()
23
    {
24
        switch ($this->orientation) {
25
            case 'inline':
26
                $this->formClasses = 'form-inline';
27
                $this->orientationDir = 'inline';
28
                break;
29
            case 'horizontal':
30
                $this->formClasses = 'form-horizontal';
31
                $this->orientationDir = 'horizontal';
32
                break;
33
            default:
34
                $this->orientationDir = 'default';
35
                break;
36
37
        }
38
    }
39
}