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

AllOfRule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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