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

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

Assert that value is an array or a traversable object.
public static isTraversable ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
Результат boolean
    public static function isTraversable($value, $message = null, $propertyPath = null)
    {
        if (!is_array($value) && !$value instanceof \Traversable) {
            $message = sprintf($message ?: 'Value "%s" is not an array and does not implement Traversable.', static::stringify($value));
            throw static::createException($value, $message, static::INVALID_TRAVERSABLE, $propertyPath);
        }
        return true;
    }