Passed
Pull Request — master (#222)
by Dmitriy
02:25
created

RuleHandlerNotFoundException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Yiisoft\Validator\Exception;
5
6
use RuntimeException;
7
use Throwable;
8
use Yiisoft\Validator\RuleInterface;
9
10
final class RuleHandlerNotFoundException extends RuntimeException
11
{
12
    public function __construct(RuleInterface $rule, ?Throwable $previous = null)
13
    {
14
        $ruleClassName = get_class($rule);
15
        $handlerClassName = $rule->getHandlerClassName();
16
17
        $message = "Handler was not found for \"{$ruleClassName}\" rule or unresolved \"{$handlerClassName}\" class.";
18
        parent::__construct($message, 0, $previous);
19
    }
20
}
21