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

RuleDTO   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
c 1
b 0
f 0
dl 0
loc 88
ccs 20
cts 20
cp 1
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A __construct() 0 8 1
A isAlterNext() 0 3 1
A getOperator() 0 3 1
A getTag() 0 3 1
A getKey() 0 3 1
A isNoKey() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPHtmlParser\DTO\Selector;
6
7
final class RuleDTO
8
{
9
    /**
10
     * @var string
11
     */
12
    private $tag;
13
14
    /**
15
     * @var string
16
     */
17
    private $operator;
18
19
    /**
20
     * @var string|array|null
21
     */
22
    private $key;
23
24
    /**
25
     * @var string|array|null
26
     */
27
    private $value;
28
29
    /**
30
     * @var bool
31
     */
32
    private $noKey;
33
34
    /**
35
     * @var bool
36
     */
37
    private $alterNext;
38
39 348
    public function __construct(array $values)
40
    {
41 348
        $this->tag = $values['tag'];
42 348
        $this->operator = $values['operator'];
43 348
        $this->key = $values['key'];
44 348
        $this->value = $values['value'];
45 348
        $this->noKey = $values['noKey'];
46 348
        $this->alterNext = $values['alterNext'];
47 348
    }
48
49
    /**
50
     * @return string
51
     */
52 336
    public function getTag(): string
53
    {
54 336
        return $this->tag;
55
    }
56
57
    /**
58
     * @return string
59
     */
60 111
    public function getOperator(): string
61
    {
62 111
        return $this->operator;
63
    }
64
65
    /**
66
     * @return string|array|null
67
     */
68 342
    public function getKey()
69
    {
70 342
        return $this->key;
71
    }
72
73
    /**
74
     * @return string|array|null
75
     */
76 123
    public function getValue()
77
    {
78 123
        return $this->value;
79
    }
80
81
    /**
82
     * @return bool
83
     */
84 123
    public function isNoKey(): bool
85
    {
86 123
        return $this->noKey;
87
    }
88
89
    /**
90
     * @return bool
91
     */
92 333
    public function isAlterNext(): bool
93
    {
94 333
        return $this->alterNext;
95
    }
96
}
97