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

ParsedSelectorDTO   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 3
A getRules() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPHtmlParser\DTO\Selector;
6
7
final class ParsedSelectorDTO
8
{
9
    /**
10
     * @var RuleDTO[]
11
     */
12
    private $rules = [];
13
14 345
    public function __construct(array $values)
15
    {
16 345
        foreach ($values as $value) {
17 345
            if ($value instanceof RuleDTO) {
18 345
                $this->rules[] = $value;
19
            }
20
        }
21 345
    }
22
23
    /**
24
     * @return RuleDTO[]
25
     */
26 345
    public function getRules(): array
27
    {
28 345
        return $this->rules;
29
    }
30
}
31