protected function buildArraySetupCode(array $array)
    {
        $code = 'array(';
        foreach ($array as $key => $value) {
            $code .= (is_string($key)) ? "'" . $key . "'" : $key;
            $code .= ' => ';
            if ($value === null) {
                $code .= 'NULL';
            } elseif (is_bool($value)) {
                $code .= ($value ? 'true' : 'false');
            } elseif (is_numeric($value)) {
                $code .= $value;
            } elseif (is_string($value)) {
                $code .= "'" . $value . "'";
            }
            $code .= ', ';
        }
        return rtrim($code, ', ') . ')';
    }
protected function buildArraySetupCode(array $array)
    {
        $code = 'array(';
        foreach ($array as $key => $value) {
            $code .= (is_string($key)) ? "'" . $key . "'" : $key;
            $code .= ' => ';
            if ($value === null) {
                $code .= 'NULL';
            } elseif (is_bool($value)) {
                $code .= ($value ? 'true' : 'false');
            } elseif (is_numeric($value)) {
                $code .= $value;
            } elseif (is_string($value)) {
                $code .= "'" . $value . "'";
            }
            $code .= ', ';
        }
        return rtrim($code, ', ') . ')';
    }
protected function buildArraySetupCode ( array $ array ) { $ code = 'array(' ; foreach ( $ array as $ key => $ value ) { $ code .= ( is_string ( $ key ) ) ? "'" . $ key . "'" : $ key ; $ code .= ' => ' ; if ( $ value === null ) { $ code .= 'NULL' ; } elseif ( is_bool ( $ value ) ) { $ code .= ( $ value ? 'true' : 'false' ) ; } elseif ( is_numeric ( $ value ) ) { $ code .= $ value ; } elseif ( is_string ( $ value ) ) { $ code .= "'" . $ value . "'" ; } $ code .= ', ' ; } return rtrim ( $ code , ', ' ) . ')' ; }
Builds a string containing PHP code to build the array given as input.

@param array $array
@return string e.g. 'array()' or 'array(1 => 'bar')
Builds a string containing PHP code to build the array given as input .