Passed
Push — master ( 1b59d3...daf3c8 )
by Smoren
02:18
created

AllOfRule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Smoren\Validator\Rules;
6
7
use Smoren\Validator\Checks\AllOfCheck;
8
use Smoren\Validator\Interfaces\CompositeRuleInterface;
9
use Smoren\Validator\Interfaces\MixedRuleInterface;
10
11
class AllOfRule extends MixedRule implements CompositeRuleInterface
12
{
13
    /**
14
     * @param string $name
15
     * @param array<MixedRuleInterface> $rules
16
     */
17 7
    public function __construct(string $name, array $rules)
18
    {
19 7
        parent::__construct($name);
20 7
        $this->check(new AllOfCheck($rules));
21
    }
22
}
23