Skip to content

Commit f96c7cd

Browse files
authored
Merge pull request #347 from odolbeau/update-commands
Commands should always return int
2 parents 9a9938f + 05230a5 commit f96c7cd

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

Command/DeleteObsoleteCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
9191
if (0 === $messageCount) {
9292
$output->writeln('No messages are obsolete');
9393

94-
return;
94+
return 0;
9595
}
9696

9797
if ($input->isInteractive()) {
9898
$helper = $this->getHelper('question');
9999
$question = new ConfirmationQuestion(\sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
100100
if (!$helper->ask($input, $output, $question)) {
101-
return;
101+
return 0;
102102
}
103103
}
104104

@@ -125,5 +125,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
125125
if ($progress) {
126126
$progress->finish();
127127
}
128+
129+
return 0;
128130
}
129131
}

Command/DownloadCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
8383
} else {
8484
$storage->download();
8585
}
86+
87+
return 0;
8688
}
8789

8890
private function hashDirectory($directory)

Command/ExtractCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
131131
);
132132
}
133133
}
134+
135+
return 0;
134136
}
135137

136138
/**

Command/StatusCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8989
if ($input->getOption('json')) {
9090
$output->writeln(\json_encode($stats));
9191

92-
return;
92+
return 0;
9393
}
9494

9595
$io = new SymfonyStyle($input, $output);
@@ -101,5 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
$io->title('Locale: '.$locale);
102102
$io->table(['Domain', 'Defined', 'New', 'Obsolete'], $rows);
103103
}
104+
105+
return 0;
104106
}
105107
}

Command/SyncCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
5757
default:
5858
$output->writeln(\sprintf('Direction must be either "up" or "down". Not "%s".', $input->getArgument('direction')));
5959

60-
return;
60+
return 0;
6161
}
6262

6363
$this->getStorage($input->getArgument('configuration'))->sync($direction);
64+
65+
return 0;
6466
}
6567
}

0 commit comments

Comments
 (0)