Conditions | 2 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function __construct( |
||
20 | /** |
||
21 | * @param mixed A variable retrieved from the container. |
||
22 | */ |
||
23 | mixed $value, |
||
24 | /** |
||
25 | * @var int The Exception code. |
||
26 | */ |
||
27 | int $code = 0, |
||
28 | /** |
||
29 | * @var Throwable|null The previous throwable used for the exception chaining. |
||
30 | */ |
||
31 | ?Throwable $previous = null, |
||
32 | ) { |
||
33 | $type = get_debug_type($value); |
||
34 | |||
35 | parent::__construct( |
||
36 | sprintf( |
||
37 | class_exists($type) |
||
38 | ? 'Handler "%1$s" must implement "%2$s".' |
||
39 | : 'Expected instance of "%2$s". Got "%1$s".', |
||
40 | $type, |
||
41 | RuleHandlerInterface::class, |
||
42 | ), |
||
43 | $code, |
||
44 | $previous |
||
45 | ); |
||
48 |