Header::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Enjoys\Forms\Elements;
6
7
use Enjoys\Forms\Element;
8
9
class Header extends Element
10
{
11
    private int $closeAfterCountElements = 0;
12
13 6
    public function __construct(string $title)
14
    {
15 6
        parent::__construct(\uniqid('header'), $title);
16 6
        $this->removeAttribute('name');
17 6
        $this->removeAttribute('id');
18
    }
19
20 1
    public function closeAfter(int $countElements): void
21
    {
22 1
        $this->closeAfterCountElements = $countElements;
23
    }
24
25 1
    public function getCloseAfterCountElements(): int
26
    {
27 1
        return $this->closeAfterCountElements;
28
    }
29
30
31 1
    public function baseHtml(): string
32
    {
33 1
        return $this->getLabel() ?? '';
34
    }
35
}
36