writeln('Não foi possível obter a instância da aplicação.');
return Command::FAILURE;
}
$container = $app->getContainer();
// PHP-DI doesn't easily expose all registered definitions unless we use internal reflection
// or a specific configuration. For simplicity in this environment, we'll list what's common.
$output->writeln('Serviços no Container DI:');
$table = new Table($output);
$table->setHeaders(['ID', 'Status']);
$commonServices = [
\DI\Container::class,
\Kernel\Application::class,
\Kernel\ModuleLoader::class,
\Kernel\View::class,
'db',
'logging',
'mailer'
];
foreach ($commonServices as $service) {
$status = $container->has($service) ? 'Registrado' : 'Não definido';
$table->addRow([$service, $status]);
}
$table->render();
return Command::SUCCESS;
}
}