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
                );
            }
        }
    }
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
                );
            }
        }
    }
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 ) ; } } }
Renders the contents of an iterator.

@param OutputInterface $output The output handler.
@param Traversable     $list   The traversable list.
@param boolean|integer $indent The indentation level.
@param string          $base   The base path.
@param Phar            $phar   The PHP archive.
@param string          $root   The root path to remove.
Renders the contents of an iterator .