Assert\Assertion::isArray PHP Метод

isArray() публичный статический Метод

Assert that value is an array.
public static isArray ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
Результат boolean
    public static function isArray($value, $message = null, $propertyPath = null)
    {
        if (!is_array($value)) {
            $message = sprintf($message ?: 'Value "%s" is not an array.', static::stringify($value));
            throw static::createException($value, $message, static::INVALID_ARRAY, $propertyPath);
        }
        return true;
    }

Usage Example

Пример #1
0
 protected function guardRequiredState()
 {
     parent::guardRequiredState();
     Assertion::regex($this->projection_type, '#^([a-z][a-z_-]+(?<!_-)\\.){2}[a-z][a-z_]+(?<!_)::projection\\.[a-z][a-z_]+(?<!_)$#');
     Assertion::isArray($this->data);
     Assertion::regex($this->projection_identifier, '/[\\w\\.\\-_]{1,128}\\-\\w{8}\\-\\w{4}\\-\\w{4}\\-\\w{4}\\-\\w{12}\\-\\w{2}_\\w{2}\\-\\d+/');
 }
All Usage Examples Of Assert\Assertion::isArray