From 68ffa32a184879fc07132457565005a5bf251529 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 18 May 2023 15:13:02 +0545 Subject: [PATCH] Always return an int from Symfony Command execute method --- lib/Command/InstallApp.php | 4 ++-- lib/Command/ListApps.php | 3 +-- lib/Command/UnInstallApp.php | 2 +- lib/Command/UpgradeApp.php | 2 +- vendor-bin/phan/composer.json | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/Command/InstallApp.php b/lib/Command/InstallApp.php index e713c3b9..f4f88bd5 100644 --- a/lib/Command/InstallApp.php +++ b/lib/Command/InstallApp.php @@ -66,10 +66,10 @@ protected function configure() { /** * @param InputInterface $input * @param OutputInterface $output - * @return int|null + * @return int * @throws \Exception */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if (!$this->marketService->canInstall()) { throw new \Exception("Installing apps is not supported because the app folder is not writable."); } diff --git a/lib/Command/ListApps.php b/lib/Command/ListApps.php index b0b24950..d434039c 100644 --- a/lib/Command/ListApps.php +++ b/lib/Command/ListApps.php @@ -23,7 +23,6 @@ use OCA\Market\MarketService; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -41,7 +40,7 @@ protected function configure() { ->setDescription('Lists apps as available on the marketplace.'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { try { $apps = $this->marketService->listApps(); } catch (\Exception $ex) { diff --git a/lib/Command/UnInstallApp.php b/lib/Command/UnInstallApp.php index d9a7ac71..7c80fdb9 100644 --- a/lib/Command/UnInstallApp.php +++ b/lib/Command/UnInstallApp.php @@ -51,7 +51,7 @@ protected function configure() { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if (!$this->marketService->canInstall()) { throw new \Exception("Un-Installing apps is not supported because the app folder is not writable."); } diff --git a/lib/Command/UpgradeApp.php b/lib/Command/UpgradeApp.php index 92b7ddfb..b6911a30 100644 --- a/lib/Command/UpgradeApp.php +++ b/lib/Command/UpgradeApp.php @@ -79,7 +79,7 @@ protected function configure() { * * @throws \Exception */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { if (!$this->marketService->canInstall()) { throw new \Exception("Installing apps is not supported because the app folder is not writable."); } diff --git a/vendor-bin/phan/composer.json b/vendor-bin/phan/composer.json index fa41a406..90031218 100644 --- a/vendor-bin/phan/composer.json +++ b/vendor-bin/phan/composer.json @@ -1,5 +1,5 @@ { "require": { - "phan/phan": "^5.2" + "phan/phan": "^5.4" } }