Header   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A closeAfter() 0 3 1
A baseHtml() 0 3 1
A __construct() 0 5 1
A getCloseAfterCountElements() 0 3 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