Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Always return an int from Symfony Command execute method #221

Merged
merged 1 commit into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/Command/ExportInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,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 {
try {
$this->instanceExporter->export(
$input->getArgument('exportDirectory')
Expand All @@ -78,5 +78,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln("<error>{$e->getMessage()}</error>");
return 1;
}
return 0;
}
}
5 changes: 3 additions & 2 deletions lib/Command/ExportUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,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 {
try {
$uid = $input->getArgument('userId');
$exportDirectory = $input->getArgument('exportDirectory');
Expand All @@ -80,5 +80,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln("<error>{$e->getMessage()}</error>");
return 1;
}
return 0;
}
}
5 changes: 3 additions & 2 deletions lib/Command/ImportInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,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 {
try {
$this->instanceImporter->import(
$input->getArgument('importDirectory')
Expand All @@ -78,5 +78,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln("<error>{$e->getMessage()}</error>");
return 1;
}
return 0;
}
}
5 changes: 3 additions & 2 deletions lib/Command/ImportUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,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 {
try {
$this->importer->import(
$input->getArgument('importDirectory'),
Expand All @@ -64,5 +64,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln("<error>{$e->getMessage()}</error>");
return 1;
}
return 0;
}
}
2 changes: 1 addition & 1 deletion lib/Command/MigrateShare.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function configure() {
->addArgument('remoteServer', InputArgument::REQUIRED, 'The remote ownCloud server where the exported user is now, for example "https://myown.server:8080/owncloud"');
}

protected function execute(InputInterface $input, OutputInterface $output) {
protected function execute(InputInterface $input, OutputInterface $output): int {
/** @var string $userId */
$userId = $input->getArgument('userId');
if (!$this->userManager->userExists($userId)) {
Expand Down