Passed
Pull Request — master (#222)
by Rustam
02:39
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Exception;
6
7
use RuntimeException;
8
use Throwable;
9
use Yiisoft\Validator\Rule\RuleHandlerInterface;
10
11
final class RuleHandlerInterfaceNotImplementedException extends RuntimeException
12
{
13 1
    public function __construct(string $name, ?Throwable $previous = null)
14
    {
15 1
        parent::__construct(
16 1
            sprintf(
17
                'Handler "%s" should implement "%s".',
18
                $name,
19
                RuleHandlerInterface::class
20
            ),
21
            0,
22
            $previous
23
        );
24
    }
25
}
26