private function contents(
        OutputInterface $output,
        Traversable $list,
        $indent,
        $base,
        Phar $phar,
        $root
    ) {
        /** @var PharFileInfo $item */
        foreach ($list as $item) {
            $item = $phar[str_replace($root, '', $item->getPathname())];

            if (false !== $indent) {
                $output->write(str_repeat(' ', $indent));

                $path = $item->getFilename();

                if ($item->isDir()) {
                    $path .= '/';
                }
            } else {
                $path = str_replace($base, '', $item->getPathname());
            }

            if ($item->isDir()) {
                $output->writeln("<info>$path</info>");
            } else {
                $compression = '';

                foreach (self::$fileAlgorithms as $code => $name) {
                    if ($item->isCompressed($code)) {
                        $compression = " <fg=cyan>[$name]</fg=cyan>";
                    }
                }

                $output->writeln($path . $compression);
            }

            if ($item->isDir()) {
                $this->contents(
                    $output,
                    new DirectoryIterator($item->getPathname()),
                    (false === $indent) ? $indent : $indent + 2,
                    $base,
                    $phar,
                    $root
                );
            }
        }
    }