Completed
Push — master ( 759acc...6a33ec )
by Denis
01:29
created

AbstractLayout   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 56
rs 10
c 0
b 0
f 0
wmc 5
lcom 2
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
setFormClasses() 0 1 ?
A __construct() 0 4 1
A orientation() 0 8 1
A getViewsDirPath() 0 4 1
A getFormClasses() 0 4 1
A getElementClasses() 0 4 1
1
<?php
2
3
namespace Ngtfkx\Laradeck\FormBuilder\Layouts;
4
5
6
abstract class AbstractLayout
7
{
8
    /**
9
     * @var string $cssFramework Тип верстки. Допустимые значения: html, bootstrap3, bootstrap4
10
     */
11
    protected $cssFramework;
12
13
    /**
14
     * @var string $orientation Тип верстки формы
15
     */
16
    protected $orientation;
17
18
    /**
19
     * @var string $formClasses Классы, которые надо назначить на форму
20
     */
21
    protected $formClasses = '';
22
23
    protected $elementClasses = '';
24
25
    protected $orientationDir;
26
27
    abstract protected function setFormClasses();
28
29
    /**
30
     * AbstractLayout constructor.
31
     */
32
    public function __construct()
33
    {
34
35
    }
36
37
    public function orientation(?string $orientation = null): self
38
    {
39
        $this->orientation = $orientation;
40
41
        $this->setFormClasses();
42
43
        return $this;
44
    }
45
46
    public function getViewsDirPath(): string
47
    {
48
        return $this->cssFramework . '.' . $this->orientationDir;
49
    }
50
51
    public function getFormClasses(): string
52
    {
53
        return $this->formClasses;
54
    }
55
56
    public function getElementClasses(): string
57
    {
58
        return $this->elementClasses;
59
    }
60
61
}