From f0d0987186b4049cdba76c1f9233a1b85ab5be7b Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 18 May 2023 15:06:44 +0545 Subject: [PATCH] Always return an int from Symfony Command execute method --- lib/Command/Db/Stress.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Command/Db/Stress.php b/lib/Command/Db/Stress.php index 6a666c8..4dd7ccf 100644 --- a/lib/Command/Db/Stress.php +++ b/lib/Command/Db/Stress.php @@ -256,10 +256,10 @@ protected function cleanup(IDBConnection $connection) { /** * @param InputInterface $input * @param OutputInterface $output - * @return int|void|null + * @return int * @throws \Exception */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $options = $input->getOptions(); if (\count(\array_intersect_assoc($options, ['rwSplit' => true, 'readCommited' => true, 'filecachePut' => true, 'cleanup' => true])) > 1) { @@ -286,9 +286,10 @@ protected function execute(InputInterface $input, OutputInterface $output) { $this->cleanup($connection); } } catch (\Exception $e) { - // we always want stactraces + // we always want a stacktrace $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); throw $e; } + return 0; } }