Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | abstract class CompositeRule extends Rule implements CompositeRuleInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var array<RuleInterface> |
||
14 | */ |
||
15 | protected array $rules = []; |
||
16 | |||
17 | /** |
||
18 | * @param array<RuleInterface> $rules |
||
19 | */ |
||
20 | 9 | public function __construct(array $rules, string $name) |
|
21 | { |
||
22 | 9 | parent::__construct($name); |
|
23 | 9 | foreach ($rules as $rule) { |
|
24 | 7 | $this->addRule($rule); |
|
25 | } |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | * |
||
31 | * @return static |
||
32 | */ |
||
33 | 7 | public function addRule(RuleInterface $rule): self |
|
37 | } |
||
38 | } |
||
39 |