| 1 | <?php |
||
| 18 | class IsArray extends Rule |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * A constant that will be used when the value does not represent an integer value. |
||
| 22 | */ |
||
| 23 | const NOT_AN_ARRAY = 'IsArray::NOT_AN_ARRAY'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The message templates which can be returned by this validator. |
||
| 27 | * |
||
| 28 | * @var array |
||
| 29 | */ |
||
| 30 | protected $messageTemplates = [ |
||
| 31 | self::NOT_AN_ARRAY => '{{ name }} must be an array', |
||
| 32 | ]; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Validates if $value is an array. |
||
| 36 | * |
||
| 37 | * @param mixed $value |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | 8 | public function validate($value) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 5 | public function shouldBreakChainOnError() |
|
| 56 | } |
||
| 57 |