| Total Complexity | 6 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | { |
||
| 19 | use HandlerClassNameTrait; |
||
| 20 | use RuleNameTrait; |
||
| 21 | |||
| 22 | public function __construct( |
||
| 23 | public string $message = 'The value is not JSON.', |
||
| 24 | public bool $skipOnEmpty = false, |
||
| 25 | public bool $skipOnError = false, |
||
| 26 | public ?Closure $when = null, |
||
| 27 | ) { |
||
| 28 | } |
||
| 29 | |||
| 30 | 1 | public function getOptions(): array |
|
| 31 | { |
||
| 32 | return [ |
||
| 33 | 'message' => [ |
||
| 34 | 1 | 'message' => $this->message, |
|
| 35 | ], |
||
| 36 | 1 | 'skipOnEmpty' => $this->skipOnEmpty, |
|
| 37 | 1 | 'skipOnError' => $this->skipOnError, |
|
| 38 | ]; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |