Skip to content

Commit a447334

Browse files
Merge pull request #13 from nextcloud/fix/noid/execute-int
fixes expectation that execute() returns an int
2 parents b940d4e + bc4ab40 commit a447334

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

lib/Command/Add.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected function interact(InputInterface $input, OutputInterface $output) {
224224
}
225225
}
226226

227-
protected function execute(InputInterface $input, OutputInterface $output) {
227+
protected function execute(InputInterface $input, OutputInterface $output): int {
228228
$config = $this->configurationService->add();
229229
$config->setAddressBookDisplayName($input->getArgument('addressBookName'));
230230

@@ -277,6 +277,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
277277
}
278278

279279
$this->configurationService->update($config);
280+
281+
return 0;
280282
}
281283

282284
protected function importConnection(InputInterface $input) {

lib/Command/Delete.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ protected function configure() {
5151
);
5252
}
5353

54-
protected function execute(InputInterface $input, OutputInterface $output) {
54+
protected function execute(InputInterface $input, OutputInterface $output): int {
5555
$id = (int)$input->getArgument('id');
5656
$this->configurationService->delete($id);
57+
return 0;
5758
}
5859
}

lib/Command/Edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ protected function interact(InputInterface $input, OutputInterface $output) {
177177

178178
}
179179

180-
public function execute(InputInterface $input, OutputInterface $output) {
180+
public function execute(InputInterface $input, OutputInterface $output): int {
181181
$config = $this->configurationService->get((int)$input->getArgument('id'));
182182

183183
foreach ($this->getListOfOptions($config) as $optionData) {
@@ -201,6 +201,7 @@ public function execute(InputInterface $input, OutputInterface $output) {
201201
}
202202

203203
$this->configurationService->update($config);
204+
return 0;
204205
}
205206

206207
private function yesOrNoNormalizer(string $input): ?bool {

lib/Command/ListConfigs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure() {
4646
->setDescription('Lists all LDAP contacts backend configurations');
4747
}
4848

49-
protected function execute(InputInterface $input, OutputInterface $output) {
49+
protected function execute(InputInterface $input, OutputInterface $output): int {
5050
$configs = $this->configurationService->getAll();
5151
foreach ($configs as $config) {
5252
/** @var ConfigurationModel $config */
@@ -59,5 +59,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
5959
}
6060
$this->writeMixedInOutputFormat($input, $output, $cfgValues);
6161
}
62+
return 0;
6263
}
6364
}

0 commit comments

Comments
 (0)