AbstractButton   A
last analyzed

Complexity

Total Complexity 18

Size/Duplication

Total Lines 194
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 18
lcom 0
cbo 0
dl 0
loc 194
rs 10
c 0
b 0
f 0

18 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getActive() 0 3 1
A getBlock() 0 3 1
A getContent() 0 3 1
A getDisabled() 0 3 1
A getOutline() 0 3 1
A getPrefix() 0 3 1
A getSize() 0 3 1
A getTitle() 0 3 1
A getType() 0 3 1
A setActive() 0 4 1
A setBlock() 0 4 1
A setContent() 0 4 1
A setDisabled() 0 4 1
A setOutline() 0 4 1
A setSize() 0 4 1
A setTitle() 0 4 1
A setType() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the bootstrap-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\BootstrapBundle\Button;
13
14
/**
15
 * Abstract button.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Bundle\BootstrapBundle\Button
19
 * @abstract
20
 */
21
abstract class AbstractButton implements ButtonInterface {
22
23
    /**
24
     * Active
25
     *
26
     * @var bool|null
27
     */
28
    private $active;
29
30
    /**
31
     * Block.
32
     *
33
     * @var bool|null
34
     */
35
    private $block;
36
37
    /**
38
     * Content.
39
     *
40
     * @var string|null
41
     */
42
    private $content;
43
44
    /**
45
     * Disabled.
46
     *
47
     * @var bool|null
48
     */
49
    private $disabled;
50
51
    /**
52
     * Outline.
53
     *
54
     * @var bool|null
55
     */
56
    private $outline;
57
58
    /**
59
     * Size.
60
     *
61
     * @var string|null
62
     */
63
    private $size;
64
65
    /**
66
     * Title.
67
     *
68
     * @var string|null
69
     */
70
    private $title;
71
72
    /**
73
     * Type.
74
     *
75
     * @var string|null
76
     */
77
    private $type;
78
79
    /**
80
     * Constructor.
81
     *
82
     * @param string|null $type The type.
83
     */
84
    protected function __construct(?string $type) {
85
        $this->setType($type);
86
    }
87
88
    /**
89
     * {@inheritDoc}
90
     */
91
    public function getActive(): ?bool {
92
        return $this->active;
93
    }
94
95
    /**
96
     * {@inheritDoc}
97
     */
98
    public function getBlock(): ?bool {
99
        return $this->block;
100
    }
101
102
    /**
103
     * {@inheritDoc}
104
     */
105
    public function getContent(): ?string {
106
        return $this->content;
107
    }
108
109
    /**
110
     * {@inheritDoc}
111
     */
112
    public function getDisabled(): ?bool {
113
        return $this->disabled;
114
    }
115
116
    /**
117
     * {@inheritDoc}
118
     */
119
    public function getOutline(): ?bool {
120
        return $this->outline;
121
    }
122
123
    /**
124
     * {@inheritDoc}
125
     */
126
    public function getPrefix(): ?string {
127
        return "btn-";
128
    }
129
130
    /**
131
     * {@inheritDoc}
132
     */
133
    public function getSize(): ?string {
134
        return $this->size;
135
    }
136
137
    /**
138
     * {@inheritDoc}
139
     */
140
    public function getTitle(): ?string {
141
        return $this->title;
142
    }
143
144
    /**
145
     * {@inheritDoc}
146
     */
147
    public function getType(): ?string {
148
        return $this->type;
149
    }
150
151
    /**
152
     * {@inheritDoc}
153
     */
154
    public function setActive(?bool $active): ButtonInterface {
155
        $this->active = $active;
156
        return $this;
157
    }
158
159
    /**
160
     * {@inheritDoc}
161
     */
162
    public function setBlock(?bool $block): ButtonInterface {
163
        $this->block = $block;
164
        return $this;
165
    }
166
167
    /**
168
     * {@inheritDoc}
169
     */
170
    public function setContent(?string $content): ButtonInterface {
171
        $this->content = $content;
172
        return $this;
173
    }
174
175
    /**
176
     * {@inheritDoc}
177
     */
178
    public function setDisabled(?bool $disabled): ButtonInterface {
179
        $this->disabled = $disabled;
180
        return $this;
181
    }
182
183
    /**
184
     * {@inheritDoc}
185
     */
186
    public function setOutline(?bool $outline): ButtonInterface {
187
        $this->outline = $outline;
188
        return $this;
189
    }
190
191
    /**
192
     * {@inheritDoc}
193
     */
194
    public function setSize(?string $size): ButtonInterface {
195
        $this->size = $size;
196
        return $this;
197
    }
198
199
    /**
200
     * {@inheritDoc}
201
     */
202
    public function setTitle(?string $title): ButtonInterface {
203
        $this->title = $title;
204
        return $this;
205
    }
206
207
    /**
208
     * {@inheritDoc}
209
     */
210
    public function setType(?string $type): ButtonInterface {
211
        $this->type = $type;
212
        return $this;
213
    }
214
}
215