diff --git a/src/Console/Command/CharacterListCommand.php b/src/Console/Command/CharacterListCommand.php index 10aca2f..40d5b76 100644 --- a/src/Console/Command/CharacterListCommand.php +++ b/src/Console/Command/CharacterListCommand.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace LotGD\Core\Console\Command; use LotGD\Core\Models\Character; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; @@ -26,7 +27,7 @@ class CharacterListCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $characters = $this->game->getEntityManager()->getRepository(Character::class)->findAll(); @@ -41,5 +42,7 @@ class CharacterListCommand extends BaseCommand } $io->table(...$table); + + return Command::SUCCESS; } } diff --git a/src/Console/Command/CharacterResetViewpointCommand.php b/src/Console/Command/CharacterResetViewpointCommand.php index 8aac95d..a22ce93 100644 --- a/src/Console/Command/CharacterResetViewpointCommand.php +++ b/src/Console/Command/CharacterResetViewpointCommand.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace LotGD\Core\Console\Command; use LotGD\Core\Models\Character; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -33,7 +34,7 @@ class CharacterResetViewpointCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $id = $input->getOption("id"); @@ -50,5 +51,7 @@ class CharacterResetViewpointCommand extends BaseCommand $character->setViewpoint(null); $this->game->getEntityManager()->flush(); + + return Command::SUCCESS; } } diff --git a/src/Console/Command/ConsoleCommand.php b/src/Console/Command/ConsoleCommand.php index 65a6f8e..91f95a5 100644 --- a/src/Console/Command/ConsoleCommand.php +++ b/src/Console/Command/ConsoleCommand.php @@ -3,6 +3,7 @@ declare(strict_types=1); namespace LotGD\Core\Console\Command; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -24,7 +25,7 @@ class ConsoleCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { print "Daenerys console, the dragon prompt. lotgd/core " . \LotGD\Core\Game::getVersion() . ".\n"; print "Enter some PHP, but be careful, this is live and attached to your currently configured setup:\n\n"; @@ -39,5 +40,7 @@ class ConsoleCommand extends BaseCommand 'g' => $this->game, ]); $boris->start(); + + return Command::SUCCESS; } } diff --git a/src/Console/Command/DatabaseInitCommand.php b/src/Console/Command/DatabaseInitCommand.php index 8a5627b..e7be7fb 100644 --- a/src/Console/Command/DatabaseInitCommand.php +++ b/src/Console/Command/DatabaseInitCommand.php @@ -25,8 +25,10 @@ class DatabaseInitCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->game->getEntityManager()->flush(); + + return Command::SUCCESS; } } diff --git a/src/Console/Command/DatabaseSchemaUpdateCommand.php b/src/Console/Command/DatabaseSchemaUpdateCommand.php index bbb20ae..21caa56 100644 --- a/src/Console/Command/DatabaseSchemaUpdateCommand.php +++ b/src/Console/Command/DatabaseSchemaUpdateCommand.php @@ -26,7 +26,7 @@ class DatabaseSchemaUpdateCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $entityManager = $this->game->getEntityManager(); $metaData = $entityManager->getMetadataFactory()->getAllMetadata(); @@ -34,5 +34,7 @@ class DatabaseSchemaUpdateCommand extends BaseCommand $schemaTool->updateSchema($metaData); $entityManager->flush(); + + return Command::SUCCESS; } } diff --git a/src/Console/Command/ModuleRegisterCommand.php b/src/Console/Command/ModuleRegisterCommand.php index c756973..27ed84e 100644 --- a/src/Console/Command/ModuleRegisterCommand.php +++ b/src/Console/Command/ModuleRegisterCommand.php @@ -5,8 +5,8 @@ namespace LotGD\Core\Console\Command; use LotGD\Core\Exceptions\ClassNotFoundException; use LotGD\Core\Exceptions\ModuleAlreadyExistsException; - use LotGD\Core\LibraryConfiguration; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; @@ -29,7 +29,7 @@ class ModuleRegisterCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $modules = $this->game->getComposerManager()->getModulePackages(); @@ -38,6 +38,8 @@ class ModuleRegisterCommand extends BaseCommand foreach ($modules as $p) { $this->registerModule($p->getName(), $io, $registered); } + + return Command::SUCCESS; } /** diff --git a/src/Console/Command/ModuleValidateCommand.php b/src/Console/Command/ModuleValidateCommand.php index 52a5476..d0b2a4c 100644 --- a/src/Console/Command/ModuleValidateCommand.php +++ b/src/Console/Command/ModuleValidateCommand.php @@ -3,6 +3,7 @@ declare(strict_types=1); namespace LotGD\Core\Console\Command; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -24,7 +25,7 @@ class ModuleValidateCommand extends BaseCommand /** * @inheritDoc */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $results = $this->game->getModuleManager()->validate(); @@ -35,6 +36,7 @@ class ModuleValidateCommand extends BaseCommand return 1; } $output->writeln("LotGD modules validated"); - return 0; + + return Command::SUCCESS; } } diff --git a/src/Game.php b/src/Game.php index ae4dd5a..dba6665 100644 --- a/src/Game.php +++ b/src/Game.php @@ -24,7 +24,7 @@ use Monolog\Logger; */ class Game { - private $entityManager; + private EntityManagerInterface $entityManager; private $eventManager; private $composerManager; private $moduleManager;