Skip to content

Commit f40c2a0

Browse files
authored
Merge pull request #39183 from shdehnavi/refactor_core_command_app
2 parents 816ddaf + 3658894 commit f40c2a0

7 files changed

Lines changed: 15 additions & 15 deletions

File tree

core/Command/App/Disable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private function disableApp(string $appId, OutputInterface $output): void {
8383
* @param CompletionContext $context
8484
* @return string[]
8585
*/
86-
public function completeOptionValues($optionName, CompletionContext $context) {
86+
public function completeOptionValues($optionName, CompletionContext $context): array {
8787
return [];
8888
}
8989

@@ -92,7 +92,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
9292
* @param CompletionContext $context
9393
* @return string[]
9494
*/
95-
public function completeArgumentValues($argumentName, CompletionContext $context) {
95+
public function completeArgumentValues($argumentName, CompletionContext $context): array {
9696
if ($argumentName === 'app-id') {
9797
return array_diff(\OC_App::getEnabledApps(true, true), $this->appManager->getAlwaysEnabledApps());
9898
}

core/Command/App/Enable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function resolveGroupIds(array $groupIds): array {
146146
* @param CompletionContext $context
147147
* @return string[]
148148
*/
149-
public function completeOptionValues($optionName, CompletionContext $context) {
149+
public function completeOptionValues($optionName, CompletionContext $context): array {
150150
if ($optionName === 'groups') {
151151
return array_map(function (IGroup $group) {
152152
return $group->getGID();
@@ -160,7 +160,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
160160
* @param CompletionContext $context
161161
* @return string[]
162162
*/
163-
public function completeArgumentValues($argumentName, CompletionContext $context) {
163+
public function completeArgumentValues($argumentName, CompletionContext $context): array {
164164
if ($argumentName === 'app-id') {
165165
$allApps = \OC_App::getAllApps();
166166
return array_diff($allApps, \OC_App::getEnabledApps(true, true));

core/Command/App/GetPath.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
use Symfony\Component\Console\Output\OutputInterface;
3030

3131
class GetPath extends Base {
32-
protected function configure() {
32+
protected function configure(): void {
3333
parent::configure();
3434

3535
$this
@@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6767
* @param CompletionContext $context
6868
* @return string[]
6969
*/
70-
public function completeArgumentValues($argumentName, CompletionContext $context) {
70+
public function completeArgumentValues($argumentName, CompletionContext $context): array {
7171
if ($argumentName === 'app') {
7272
return \OC_App::getAllApps();
7373
}

core/Command/App/Install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
use Symfony\Component\Console\Output\OutputInterface;
3737

3838
class Install extends Command {
39-
protected function configure() {
39+
protected function configure(): void {
4040
$this
4141
->setName('app:install')
4242
->setDescription('install an app')

core/Command/App/ListApps.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
parent::__construct();
4040
}
4141

42-
protected function configure() {
42+
protected function configure(): void {
4343
parent::configure();
4444

4545
$this
@@ -98,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9898
* @param OutputInterface $output
9999
* @param array $items
100100
*/
101-
protected function writeAppList(InputInterface $input, OutputInterface $output, $items) {
101+
protected function writeAppList(InputInterface $input, OutputInterface $output, $items): void {
102102
switch ($input->getOption('output')) {
103103
case self::OUTPUT_FORMAT_PLAIN:
104104
$output->writeln('Enabled:');
@@ -119,7 +119,7 @@ protected function writeAppList(InputInterface $input, OutputInterface $output,
119119
* @param CompletionContext $context
120120
* @return array
121121
*/
122-
public function completeOptionValues($optionName, CompletionContext $context) {
122+
public function completeOptionValues($optionName, CompletionContext $context): array {
123123
if ($optionName === 'shipped') {
124124
return ['true', 'false'];
125125
}
@@ -131,7 +131,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
131131
* @param CompletionContext $context
132132
* @return string[]
133133
*/
134-
public function completeArgumentValues($argumentName, CompletionContext $context) {
134+
public function completeArgumentValues($argumentName, CompletionContext $context): array {
135135
return [];
136136
}
137137
}

core/Command/App/Remove.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(
4747
parent::__construct();
4848
}
4949

50-
protected function configure() {
50+
protected function configure(): void {
5151
$this
5252
->setName('app:remove')
5353
->setDescription('remove an app')
@@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
124124
* @param CompletionContext $context
125125
* @return string[]
126126
*/
127-
public function completeOptionValues($optionName, CompletionContext $context) {
127+
public function completeOptionValues($optionName, CompletionContext $context): array {
128128
return [];
129129
}
130130

@@ -133,7 +133,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
133133
* @param CompletionContext $context
134134
* @return string[]
135135
*/
136-
public function completeArgumentValues($argumentName, CompletionContext $context) {
136+
public function completeArgumentValues($argumentName, CompletionContext $context): array {
137137
if ($argumentName === 'app-id') {
138138
return \OC_App::getAllApps();
139139
}

core/Command/App/Update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
parent::__construct();
4646
}
4747

48-
protected function configure() {
48+
protected function configure(): void {
4949
$this
5050
->setName('app:update')
5151
->setDescription('update an app or all apps')

0 commit comments

Comments
 (0)