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

BoolMixedRule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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