protected function generateArrayValue(array $value)
    {
        $value = $this->prepareArrayValue($value);
        $outputMode = count($value) > 1 ? $this->outputMode : self::OUTPUT_SINGLE_LINE;

        $code = 'array(';
        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $code .= $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString() . $this->getIndentationString();
        }

        $outputParts = array();
        $noKeyIndex = 0;
        foreach ($value as $n => $v) {
            $v->setIndentationLevel($this->getIndentationLevel() + 1);
            $v->setOutputMode($this->outputMode);
            $partV = $v->generate();
            if ($n === $noKeyIndex) {
                $outputParts[] = $partV;
                $noKeyIndex++;
            } else {
                $outputParts[] = (is_int($n) === true ? $n : $this->escapeStringValue($n)) . ' => ' . $partV;
            }
        }

        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $padding = $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString() . $this->getIndentationString();
        } else {
            $padding = ' ';
        }

        $code .= implode(',' . $padding, $outputParts);
        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $code .= $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString();
        }
        $code .= ')';

        return $code;
    }
protected function generateArrayValue(array $value)
    {
        $value = $this->prepareArrayValue($value);
        $outputMode = count($value) > 1 ? $this->outputMode : self::OUTPUT_SINGLE_LINE;

        $code = 'array(';
        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $code .= $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString() . $this->getIndentationString();
        }

        $outputParts = array();
        $noKeyIndex = 0;
        foreach ($value as $n => $v) {
            $v->setIndentationLevel($this->getIndentationLevel() + 1);
            $v->setOutputMode($this->outputMode);
            $partV = $v->generate();
            if ($n === $noKeyIndex) {
                $outputParts[] = $partV;
                $noKeyIndex++;
            } else {
                $outputParts[] = (is_int($n) === true ? $n : $this->escapeStringValue($n)) . ' => ' . $partV;
            }
        }

        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $padding = $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString() . $this->getIndentationString();
        } else {
            $padding = ' ';
        }

        $code .= implode(',' . $padding, $outputParts);
        if ($outputMode === self::OUTPUT_MULTI_LINE) {
            $code .= $this->getLineFeed() . $this->getIndentation() . $this->getIndentationString();
        }
        $code .= ')';

        return $code;
    }
protected function generateArrayValue ( array $ value ) { $ value = $ this -> prepareArrayValue ( $ value ) ; $ outputMode = count ( $ value ) > 1 ? $ this -> outputMode : self :: OUTPUT_SINGLE_LINE ; $ code = 'array(' ; if ( $ outputMode === self :: OUTPUT_MULTI_LINE ) { $ code .= $ this -> getLineFeed ( ) . $ this -> getIndentation ( ) . $ this -> getIndentationString ( ) . $ this -> getIndentationString ( ) ; } $ outputParts = array ( ) ; $ noKeyIndex = 0 ; foreach ( $ value as $ n => $ v ) { $ v -> setIndentationLevel ( $ this -> getIndentationLevel ( ) + 1 ) ; $ v -> setOutputMode ( $ this -> outputMode ) ; $ partV = $ v -> generate ( ) ; if ( $ n === $ noKeyIndex ) { $ outputParts [ ] = $ partV ; $ noKeyIndex ++ ; } else { $ outputParts [ ] = ( is_int ( $ n ) === true ? $ n : $ this -> escapeStringValue ( $ n ) ) . ' => ' . $ partV ; } } if ( $ outputMode === self :: OUTPUT_MULTI_LINE ) { $ padding = $ this -> getLineFeed ( ) . $ this -> getIndentation ( ) . $ this -> getIndentationString ( ) . $ this -> getIndentationString ( ) ; } else { $ padding = ' ' ; } $ code .= implode ( ',' . $ padding , $ outputParts ) ; if ( $ outputMode === self :: OUTPUT_MULTI_LINE ) { $ code .= $ this -> getLineFeed ( ) . $ this -> getIndentation ( ) . $ this -> getIndentationString ( ) ; } $ code .= ')' ; return $ code ; }
Generate the code of an array.

@param array $value The value to generate.
@return string
Generate the code of an array .