Total Complexity | 4 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 70% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class CallbackRuleException extends \Exception implements FriendlyExceptionInterface |
||
12 | { |
||
13 | 1 | public function __construct($result, $code = 0, Throwable $previous = null) |
|
14 | { |
||
15 | 1 | $message = sprintf( |
|
16 | 1 | 'Return value of callback must be an instance of %s, %s returned.', |
|
17 | 1 | Result::class, |
|
18 | 1 | is_object($result) ? get_class($result) : gettype($result) |
|
19 | ); |
||
20 | |||
21 | 1 | parent::__construct($message, $code, $previous); |
|
22 | 1 | } |
|
23 | |||
24 | public function getName(): string |
||
25 | { |
||
26 | return 'Invalid callable return value'; |
||
27 | } |
||
28 | |||
29 | public function getSolution(): ?string |
||
32 | The callback must return an instance of \\Yiisoft\\Validator\\Result. An example of a valid callback: |
||
33 | static function (): \\Yiisoft\\Validator\\Result |
||
34 | { |
||
44 |