public static function allToArray($value)
    {
        if ($value instanceof \Traversable) {
            $value = iterator_to_array($value);
        }

        if (is_object($value)) {
            $value = get_object_vars($value);
        }

        $value = (array) $value;

        foreach ($value as $k => $v) {
            if (!static::isValidValue($v)) {
                throw new \InvalidArgumentException('Value :' . $value . ' is invalid.');
            }
        }

        return $value;
    }
public static function allToArray($value)
    {
        if ($value instanceof \Traversable) {
            $value = iterator_to_array($value);
        }

        if (is_object($value)) {
            $value = get_object_vars($value);
        }

        $value = (array) $value;

        foreach ($value as $k => $v) {
            if (!static::isValidValue($v)) {
                throw new \InvalidArgumentException('Value :' . $value . ' is invalid.');
            }
        }

        return $value;
    }
public static function allToArray ( $ value ) { if ( $ value instanceof \ Traversable ) { $ value = iterator_to_array ( $ value ) ; } if ( is_object ( $ value ) ) { $ value = get_object_vars ( $ value ) ; } $ value = ( array ) $ value ; foreach ( $ value as $ k => $ v ) { if ( ! static :: isValidValue ( $ v ) ) { throw new \ InvalidArgumentException ( 'Value :' . $ value . ' is invalid.' ) ; } } return $ value ; }
Convert values to array.

@param   mixed $value Value to convert to array.

@return  array  Converted array.
Convert values to array .