Passed
Push — master ( 668c77...c11634 )
by Gilles
02:19
created

TagDTO   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 54
ccs 14
cts 14
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTag() 0 3 1
A getNode() 0 3 1
A isClosing() 0 3 1
A isStatus() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPHtmlParser\DTO;
6
7
use PHPHtmlParser\Dom\Node\HtmlNode;
8
9
final class TagDTO
10
{
11
    /**
12
     * @var bool
13
     */
14
    private $status;
15
16
    /**
17
     * @var bool
18
     */
19
    private $closing;
20
21
    /**
22
     * @var ?HtmlNode
23
     */
24
    private $node;
25
26
    /**
27
     * @var ?string
28
     */
29
    private $tag;
30
31 288
    public function __construct(array $values = [])
32
    {
33 288
        $this->status = $values['status'] ?? false;
34 288
        $this->closing = $values['closing'] ?? false;
35 288
        $this->node = $values['node'] ?? null;
36 288
        $this->tag = $values['tag'] ?? null;
37 288
    }
38
39 288
    public function isStatus(): bool
40
    {
41 288
        return $this->status;
42
    }
43
44 282
    public function isClosing(): bool
45
    {
46 282
        return $this->closing;
47
    }
48
49
    /**
50
     * @return mixed
51
     */
52 282
    public function getNode(): ?HtmlNode
53
    {
54 282
        return $this->node;
55
    }
56
57
    /**
58
     * @return mixed
59
     */
60 252
    public function getTag(): ?string
61
    {
62 252
        return $this->tag;
63
    }
64
}
65