Total Complexity | 6 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 | private function __construct(array $values = []) |
|
37 | 288 | } |
|
38 | |||
39 | 288 | public static function makeFromPrimitives(bool $status = false, bool $closing = false, ?HtmlNode $node = null, ?string $tag = null): TagDTO |
|
40 | { |
||
41 | 288 | return new TagDTO([ |
|
42 | 288 | 'status' => $status, |
|
43 | 288 | 'closing' => $closing, |
|
44 | 288 | 'node' => $node, |
|
45 | 288 | 'tag' => $tag, |
|
46 | ]); |
||
47 | } |
||
48 | |||
49 | 288 | public function isStatus(): bool |
|
50 | { |
||
51 | 288 | return $this->status; |
|
52 | } |
||
53 | |||
54 | 282 | public function isClosing(): bool |
|
55 | { |
||
56 | 282 | return $this->closing; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 282 | public function getNode(): ?HtmlNode |
|
63 | { |
||
64 | 282 | return $this->node; |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return mixed |
||
69 | */ |
||
70 | 252 | public function getTag(): ?string |
|
73 | } |
||
74 | } |
||
75 |