diff --git a/Command/AboutCommand.php b/Command/AboutCommand.php index cf3e946f6..0ca4172de 100644 --- a/Command/AboutCommand.php +++ b/Command/AboutCommand.php @@ -54,7 +54,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); @@ -100,6 +100,8 @@ protected function execute(InputInterface $input, OutputInterface $output) } $io->table([], $rows); + + return 0; } private static function formatPath(string $path, string $baseDir): string diff --git a/Command/CacheClearCommand.php b/Command/CacheClearCommand.php index 24aa8171c..6711e456b 100644 --- a/Command/CacheClearCommand.php +++ b/Command/CacheClearCommand.php @@ -72,7 +72,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $fs = $this->filesystem; $io = new SymfonyStyle($input, $output); @@ -175,6 +175,8 @@ protected function execute(InputInterface $input, OutputInterface $output) } $io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully cleared.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true))); + + return 0; } private function warmup(string $warmupDir, string $realCacheDir, bool $enableOptionalWarmers = true) diff --git a/Command/CachePoolClearCommand.php b/Command/CachePoolClearCommand.php index dc42910d3..50aacd9bb 100644 --- a/Command/CachePoolClearCommand.php +++ b/Command/CachePoolClearCommand.php @@ -60,7 +60,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $kernel = $this->getApplication()->getKernel(); @@ -99,5 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $io->success('Cache was successfully cleared.'); + + return 0; } } diff --git a/Command/CachePoolDeleteCommand.php b/Command/CachePoolDeleteCommand.php index 656f9a9de..2a7a2fe51 100644 --- a/Command/CachePoolDeleteCommand.php +++ b/Command/CachePoolDeleteCommand.php @@ -59,7 +59,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $pool = $input->getArgument('pool'); @@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (!$cachePool->hasItem($key)) { $io->note(sprintf('Cache item "%s" does not exist in cache pool "%s".', $key, $pool)); - return; + return 0; } if (!$cachePool->deleteItem($key)) { @@ -77,5 +77,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $io->success(sprintf('Cache item "%s" was successfully deleted.', $key)); + + return 0; } } diff --git a/Command/CachePoolListCommand.php b/Command/CachePoolListCommand.php index 4f399ab61..7b725411d 100644 --- a/Command/CachePoolListCommand.php +++ b/Command/CachePoolListCommand.php @@ -51,12 +51,14 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $io->table(['Pool name'], array_map(function ($pool) { return [$pool]; }, $this->poolNames)); + + return 0; } } diff --git a/Command/CachePoolPruneCommand.php b/Command/CachePoolPruneCommand.php index 74b530637..65f3ff6b5 100644 --- a/Command/CachePoolPruneCommand.php +++ b/Command/CachePoolPruneCommand.php @@ -57,7 +57,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); @@ -67,5 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $io->success('Successfully pruned cache pool(s).'); + + return 0; } } diff --git a/Command/CacheWarmupCommand.php b/Command/CacheWarmupCommand.php index 04b5d2f7c..0a87acf26 100644 --- a/Command/CacheWarmupCommand.php +++ b/Command/CacheWarmupCommand.php @@ -66,7 +66,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); @@ -80,5 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->cacheWarmer->warmUp($kernel->getContainer()->getParameter('kernel.cache_dir')); $io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully warmed.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true))); + + return 0; } } diff --git a/Command/ConfigDebugCommand.php b/Command/ConfigDebugCommand.php index 4761b66ad..2aa631eb7 100644 --- a/Command/ConfigDebugCommand.php +++ b/Command/ConfigDebugCommand.php @@ -63,7 +63,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $errorIo = $io->getErrorStyle(); @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $errorIo->comment('Provide the name of a bundle as the first argument of this command to dump its configuration. (e.g. debug:config FrameworkBundle)'); $errorIo->comment('For dumping a specific option, add its path as the second argument of this command. (e.g. debug:config FrameworkBundle serializer to dump the framework.serializer configuration)'); - return; + return 0; } $extension = $this->findExtension($name); @@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $io->writeln(Yaml::dump([$extensionAlias => $config], 10)); - return; + return 0; } try { @@ -109,12 +109,14 @@ protected function execute(InputInterface $input, OutputInterface $output) } catch (LogicException $e) { $errorIo->error($e->getMessage()); - return; + return 1; } $io->title(sprintf('Current configuration for "%s.%s"', $extensionAlias, $path)); $io->writeln(Yaml::dump($config, 10)); + + return 0; } private function compileContainer(): ContainerBuilder diff --git a/Command/ContainerDebugCommand.php b/Command/ContainerDebugCommand.php index 8578462ab..13d62b383 100644 --- a/Command/ContainerDebugCommand.php +++ b/Command/ContainerDebugCommand.php @@ -113,7 +113,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $errorIo = $io->getErrorStyle(); @@ -179,6 +179,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $errorIo->comment('To search for a specific service, re-run this command with a search term. (e.g. debug:container log)'); } } + + return 0; } /** diff --git a/Command/EventDispatcherDebugCommand.php b/Command/EventDispatcherDebugCommand.php index e61f543e7..ad49cdeea 100644 --- a/Command/EventDispatcherDebugCommand.php +++ b/Command/EventDispatcherDebugCommand.php @@ -69,7 +69,7 @@ protected function configure() * * @throws \LogicException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (!$this->dispatcher->hasListeners($event)) { $io->getErrorStyle()->warning(sprintf('The event "%s" does not have any registered listeners.', $event)); - return; + return 0; } $options = ['event' => $event]; @@ -89,5 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $options['raw_text'] = $input->getOption('raw'); $options['output'] = $io; $helper->describe($io, $this->dispatcher, $options); + + return 0; } } diff --git a/Command/RouterDebugCommand.php b/Command/RouterDebugCommand.php index bad3fa059..9724e5122 100644 --- a/Command/RouterDebugCommand.php +++ b/Command/RouterDebugCommand.php @@ -73,7 +73,7 @@ protected function configure() * * @throws InvalidArgumentException When route does not exist */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $name = $input->getArgument('name'); @@ -105,6 +105,8 @@ protected function execute(InputInterface $input, OutputInterface $output) 'output' => $io, ]); } + + return 0; } private function findRouteNameContaining(string $name, RouteCollection $routes): array diff --git a/Command/TranslationDebugCommand.php b/Command/TranslationDebugCommand.php index 4ecf58be8..24290a43c 100644 --- a/Command/TranslationDebugCommand.php +++ b/Command/TranslationDebugCommand.php @@ -117,7 +117,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); @@ -191,7 +191,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $io->getErrorStyle()->warning($outputMessage); - return; + return 0; } // Load the fallback catalogues @@ -240,6 +240,8 @@ protected function execute(InputInterface $input, OutputInterface $output) } $io->table($headers, $rows); + + return 0; } private function formatState(int $state): string diff --git a/Command/WorkflowDumpCommand.php b/Command/WorkflowDumpCommand.php index ff91dc781..cec930da1 100644 --- a/Command/WorkflowDumpCommand.php +++ b/Command/WorkflowDumpCommand.php @@ -59,7 +59,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $container = $this->getApplication()->getKernel()->getContainer(); $serviceId = $input->getArgument('name'); @@ -97,5 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ], ]; $output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options)); + + return 0; } } diff --git a/Resources/config/annotations.xml b/Resources/config/annotations.xml index 05dffbc29..0ce6bf659 100644 --- a/Resources/config/annotations.xml +++ b/Resources/config/annotations.xml @@ -36,7 +36,7 @@ %kernel.cache_dir%/annotations.php - #^Symfony\\(?:Component\\HttpKernel\\|Bundle\\FrameworkBundle\\Controller\\(?!AbstractController$|Controller$))# + #^Symfony\\(?:Component\\HttpKernel\\|Bundle\\FrameworkBundle\\Controller\\(?!.*Controller$))# %kernel.debug% diff --git a/composer.json b/composer.json index 52da5d095..24c8a642d 100644 --- a/composer.json +++ b/composer.json @@ -83,6 +83,7 @@ "symfony/twig-bridge": "<4.4", "symfony/twig-bundle": "<4.4", "symfony/validator": "<4.4", + "symfony/var-dumper": "<4.4", "symfony/workflow": "<4.4" }, "suggest": {