private function getFormattedArray(array $array, $depth, array $options, callable $encode)
    {
        $lines = $this->getPairs($array, ' ', $options['array.omit'], $encode, $omitted);

        if ($omitted && $options['array.inline'] !== false) {
            $output = $this->getInlineArray($lines, $options);

            if ($output !== false) {
                return $output;
            }
        }

        return $this->buildArray($lines, $depth, $options);
    }