Passed
Push — master ( 295792...3cace9 )
by Smoren
03:09
created

BoolMixedRule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 8
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Smoren\Validator\Rules;
6
7
use Smoren\Validator\Factories\CheckBuilder;
8
use Smoren\Validator\Interfaces\BoolRuleInterface;
9
use Smoren\Validator\Structs\CheckName;
10
11
class BoolMixedRule extends MixedRule implements BoolRuleInterface
12
{
13
    /**
14
     * @param string $name
15
     */
16 22
    public function __construct(string $name)
17
    {
18 22
        parent::__construct($name);
19 22
        $this->check(
20 22
            CheckBuilder::create(CheckName::BOOL)
21 22
                ->withPredicate(fn ($value) => \is_bool($value))
22 22
                ->build(),
23 22
            true
24 22
        );
25
    }
26
}
27