From afbd43418164121b457b75a76147c8f88c4e9928 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 18 May 2023 15:10:19 +0545 Subject: [PATCH] Always return an int from Symfony Command execute method --- lib/command/createbucket.php | 5 +++-- lib/command/s3list.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/command/createbucket.php b/lib/command/createbucket.php index f773fe85..bc25589b 100644 --- a/lib/command/createbucket.php +++ b/lib/command/createbucket.php @@ -59,9 +59,9 @@ protected function configure() { * @param InputInterface $input * @param OutputInterface $output * - * @return int|null|void + * @return int */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if (!$input->getOption('accept-warning')) { $helper = new QuestionHelper(); $q = << 'Enabled', 'MFADelete' => 'Disabled'] ]); + return 0; } private function getClient() { diff --git a/lib/command/s3list.php b/lib/command/s3list.php index 06a9dacd..293ee862 100644 --- a/lib/command/s3list.php +++ b/lib/command/s3list.php @@ -55,9 +55,9 @@ protected function configure() { * @param InputInterface $input * @param OutputInterface $output * - * @return int|null|void + * @return int */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $client = $this->getClient(); $bucketName = $input->getArgument('bucket'); @@ -100,6 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $this->printValue($output, $markers, ['Key', 'LastModified', 'VersionId', 'IsLatest']); } } + return 0; } private function getClient() {