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

AllOfRule::execute()   A

Complexity

Conditions 5
Paths 7

Size

Total Lines 24
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 5

Importance

Changes 0
Metric Value
cc 5
eloc 14
nc 7
nop 1
dl 0
loc 24
ccs 14
cts 14
cp 1
crap 5
rs 9.4888
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A AllOfRule::__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