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

AnyOfRule::execute()   A

Complexity

Conditions 5
Paths 6

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