for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Gacela\Console\Infrastructure\Command;
use Gacela\Console\ConsoleFacade;
use Gacela\Framework\DocBlockResolverAwareTrait;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @method ConsoleFacade getFacade()
*/
final class ListModulesCommand extends Command
{
use DocBlockResolverAwareTrait;
protected function configure(): void
$this->setName('list:modules')
->setDescription('Render all modules found');
}
protected function execute(InputInterface $input, OutputInterface $output): int
$modules = $this->getFacade()->findAllAppModules();
$table = new Table($output);
$table->setHeaders(['class_name', 'namespace']);
foreach ($modules as $module) {
$table->addRow([
$module->className(),
$module->fullyQualifiedClassName(),
]);
$output->writeln('Modules found:');
$table->render();
return self::SUCCESS;