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

AbstractLayout::orientation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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
}