Completed
Push — master ( ebd2ab...759acc )
by Denis
01:24
created

AbstractLayout   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
setFormClasses() 0 1 ?
A __construct() 0 5 1
A orientation() 0 8 1
A getFormClasses() 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
    abstract protected function setFormClasses();
24
25
    /**
26
     * AbstractLayout constructor.
27
     * @param string $cssFramework
28
     * @param string $orientation
29
     */
30
    public function __construct(string $cssFramework = 'html', ?string $orientation = null)
31
    {
32
        $this->cssFramework = $cssFramework;
33
        $this->orientation($orientation);
34
    }
35
36
    public function orientation(?string $orientation = null): self
37
    {
38
        $this->orientation = $orientation;
39
40
        $this->setFormClasses();
41
42
        return $this;
43
    }
44
45
    public function getFormClasses(): string
46
    {
47
        return $this->formClasses;
48
    }
49
50
}