src/Viserio/Component/Parser/Dumper/IniDumper.php
protected function writeSection(string $section, array $array): string
    {
        $subsections = [];
        $output      = '[' . $section . ']' . \PHP_EOL;

        foreach ($array as $key => $value) {
            if (\is_array($value) || \is_object($value)) {
                $subsections[$key] = \is_array($value) ? $value : (array) $value;
            } else {
                $output .= \str_replace('=', '_', $key) . '=';
                $output .= self::export($value);
                $output .= \PHP_EOL;
            }
        }

        if (! empty($subsections)) {
            $output .= \PHP_EOL;

            foreach ($subsections as $subsection => $data) {
                if (\is_array($data)) {
                    foreach ($data as $key => $value) {
                        $output .= $subsection . '[' . (\is_string($key) ? $key : '') . ']=' . self::export($value);
                    }
                } else {
                    $output .= $subsection . '[]=' . $data;
                }
            }
        }

        return $output;
    }
protected function writeSection(string $section, array $array): string
    {
        $subsections = [];
        $output      = '[' . $section . ']' . \PHP_EOL;

        foreach ($array as $key => $value) {
            if (\is_array($value) || \is_object($value)) {
                $subsections[$key] = \is_array($value) ? $value : (array) $value;
            } else {
                $output .= \str_replace('=', '_', $key) . '=';
                $output .= self::export($value);
                $output .= \PHP_EOL;
            }
        }

        if (! empty($subsections)) {
            $output .= \PHP_EOL;

            foreach ($subsections as $subsection => $data) {
                if (\is_array($data)) {
                    foreach ($data as $key => $value) {
                        $output .= $subsection . '[' . (\is_string($key) ? $key : '') . ']=' . self::export($value);
                    }
                } else {
                    $output .= $subsection . '[]=' . $data;
                }
            }
        }

        return $output;
    }
@param string $section
@param array  $array

@return string