24 lines
353 B
PHP
24 lines
353 B
PHP
|
<?php
|
||
|
|
||
|
namespace Violin\Rules;
|
||
|
|
||
|
use Violin\Contracts\RuleContract;
|
||
|
|
||
|
class ArrayRule implements RuleContract
|
||
|
{
|
||
|
public function run($value, $input, $args)
|
||
|
{
|
||
|
return is_array($value);
|
||
|
}
|
||
|
|
||
|
public function error()
|
||
|
{
|
||
|
return '{field} must be an array.';
|
||
|
}
|
||
|
|
||
|
public function canSkip()
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
}
|