Skip to content

Commit

Permalink
Merge pull request #1233 from owncloud/symfony-command-execute-int
Browse files Browse the repository at this point in the history
Always return an int from Symfony Command execute method
  • Loading branch information
phil-davis authored May 18, 2023
2 parents fcfaa3d + 68ffa32 commit 3cde0d3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Command/InstallApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Command/ListApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/UnInstallApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/UpgradeApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/phan/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"phan/phan": "^5.2"
"phan/phan": "^5.4"
}
}

0 comments on commit 3cde0d3

Please sign in to comment.