private function getAlignedArray(array $array, $depth, array $options, callable $encode)
    {
        $next = 0;
        $omit = $options['array.omit'];

        foreach (array_keys($array) as $key) {
            if ($key !== $next++) {
                $omit = false;
                break;
            }
        }

        return $omit
            ? $this->getFormattedArray($array, $depth, $options, $encode)
            : $this->buildArray($this->getAlignedPairs($array, $encode), $depth, $options);
    }