public function dump($values) : string
    {
        if (! is_array($values))
            throw new DumpException($this, $values, self::ERROR);
        $items = [];
        $index = 0;
        try {
            foreach ($values as $key => $value) {
                $index = $key;
                $items[] = $this->syntax->dump($value);
            }
        } catch (DumpException $e) {
            throw new DumpException($this, $values, "Unable to dump item at key {$index}", [], $e);
        }

        return Text::join($items, $this->separator);
    }
public function dump($values) : string
    {
        if (! is_array($values))
            throw new DumpException($this, $values, self::ERROR);
        $items = [];
        $index = 0;
        try {
            foreach ($values as $key => $value) {
                $index = $key;
                $items[] = $this->syntax->dump($value);
            }
        } catch (DumpException $e) {
            throw new DumpException($this, $values, "Unable to dump item at key {$index}", [], $e);
        }

        return Text::join($items, $this->separator);
    }
public function dump ( $ values ) : string { if ( ! is_array ( $ values ) ) throw new DumpException ( $ this , $ values , self :: ERROR ) ; $ items = [ ] ; $ index = 0 ; try { foreach ( $ values as $ key => $ value ) { $ index = $ key ; $ items [ ] = $ this -> syntax -> dump ( $ value ) ; } } catch ( DumpException $ e ) { throw new DumpException ( $ this , $ values , "Unable to dump item at key {$index}" , [ ] , $ e ) ; } return Text :: join ( $ items , $ this -> separator ) ; }
Converts the given array to a string based
on the syntax or throws a DumpException.

@param  array $values the data to encode
@return string

@throws Tarsana\Syntax\Exceptions\DumpException
Converts the given array to a string based on the syntax or throws a DumpException .