protected function describeCommands(Application $application, OutputInterface $output): DescriberContract
    {
        $this->width = 0;

        $namespaces = collect($application->all())->filter(function ($command) {
            return ! $command->isHidden();
        })->groupBy(function ($command) {
            $nameParts = explode(':', $name = $command->getName());
            $this->width = max($this->width, mb_strlen($name));

            return isset($nameParts[1]) ? $nameParts[0] : '';
        })->sortKeys()->each(function ($commands) use ($output) {
            $output->write("\n");

            $commands = $commands->toArray();

            usort($commands, function ($a, $b) {
                return $a->getName() > $b->getName();
            });

            foreach ($commands as $command) {
                $output->write(sprintf(
                    "  <fg=green>%s</>%s%s\n",
                    $command->getName(),
                    str_repeat(' ', $this->width - mb_strlen($command->getName()) + 1),
                    $command->getDescription()
                ));
            }
        });

        return $this;
    }
protected function describeCommands(Application $application, OutputInterface $output): DescriberContract
    {
        $this->width = 0;

        $namespaces = collect($application->all())->filter(function ($command) {
            return ! $command->isHidden();
        })->groupBy(function ($command) {
            $nameParts = explode(':', $name = $command->getName());
            $this->width = max($this->width, mb_strlen($name));

            return isset($nameParts[1]) ? $nameParts[0] : '';
        })->sortKeys()->each(function ($commands) use ($output) {
            $output->write("\n");

            $commands = $commands->toArray();

            usort($commands, function ($a, $b) {
                return $a->getName() > $b->getName();
            });

            foreach ($commands as $command) {
                $output->write(sprintf(
                    "  <fg=green>%s</>%s%s\n",
                    $command->getName(),
                    str_repeat(' ', $this->width - mb_strlen($command->getName()) + 1),
                    $command->getDescription()
                ));
            }
        });

        return $this;
    }
protected function describeCommands ( Application $ application , OutputInterface $ output ) : DescriberContract { $ this -> width = 0 ; $ namespaces = collect ( $ application -> all ( ) ) -> filter ( function ( $ command ) { return ! $ command -> isHidden ( ) ; } ) -> groupBy ( function ( $ command ) { $ nameParts = explode ( ':' , $ name = $ command -> getName ( ) ) ; $ this -> width = max ( $ this -> width , mb_strlen ( $ name ) ) ; return isset ( $ nameParts [ 1 ] ) ? $ nameParts [ 0 ] : '' ; } ) -> sortKeys ( ) -> each ( function ( $ commands ) use ( $ output ) { $ output -> write ( "\n" ) ; $ commands = $ commands -> toArray ( ) ; usort ( $ commands , function ( $ a , $ b ) { return $ a -> getName ( ) > $ b -> getName ( ) ; } ) ; foreach ( $ commands as $ command ) { $ output -> write ( sprintf ( "  <fg=green>%s</>%s%s\n" , $ command -> getName ( ) , str_repeat ( ' ' , $ this -> width - mb_strlen ( $ command -> getName ( ) ) + 1 ) , $ command -> getDescription ( ) ) ) ; } } ) ; return $ this ; }
Describes the application commands.

@param \Illuminate\Console\Application $application
@param \Symfony\Component\Console\Output\OutputInterface $output

@return \NunoMaduro\LaravelConsoleSummary\Contracts\DescriberContract
Describes the application commands .