Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor core/Command/App #39183

Merged
merged 3 commits into from
Feb 23, 2024
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
4 changes: 2 additions & 2 deletions core/Command/App/Disable.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private function disableApp(string $appId, OutputInterface $output): void {
* @param CompletionContext $context
* @return string[]
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
return [];
}

Expand All @@ -92,7 +92,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
* @param CompletionContext $context
* @return string[]
*/
public function completeArgumentValues($argumentName, CompletionContext $context) {
public function completeArgumentValues($argumentName, CompletionContext $context): array {
if ($argumentName === 'app-id') {
return array_diff(\OC_App::getEnabledApps(true, true), $this->appManager->getAlwaysEnabledApps());
}
Expand Down
4 changes: 2 additions & 2 deletions core/Command/App/Enable.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private function resolveGroupIds(array $groupIds): array {
* @param CompletionContext $context
* @return string[]
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
if ($optionName === 'groups') {
return array_map(function (IGroup $group) {
return $group->getGID();
Expand All @@ -160,7 +160,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
* @param CompletionContext $context
* @return string[]
*/
public function completeArgumentValues($argumentName, CompletionContext $context) {
public function completeArgumentValues($argumentName, CompletionContext $context): array {
if ($argumentName === 'app-id') {
$allApps = \OC_App::getAllApps();
return array_diff($allApps, \OC_App::getEnabledApps(true, true));
Expand Down
4 changes: 2 additions & 2 deletions core/Command/App/GetPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use Symfony\Component\Console\Output\OutputInterface;

class GetPath extends Base {
protected function configure() {
protected function configure(): void {
parent::configure();

$this
Expand Down Expand Up @@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
* @param CompletionContext $context
* @return string[]
*/
public function completeArgumentValues($argumentName, CompletionContext $context) {
public function completeArgumentValues($argumentName, CompletionContext $context): array {
if ($argumentName === 'app') {
return \OC_App::getAllApps();
}
Expand Down
2 changes: 1 addition & 1 deletion core/Command/App/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use Symfony\Component\Console\Output\OutputInterface;

class Install extends Command {
protected function configure() {
protected function configure(): void {
$this
->setName('app:install')
->setDescription('install an app')
Expand Down
8 changes: 4 additions & 4 deletions core/Command/App/ListApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
parent::__construct();
}

protected function configure() {
protected function configure(): void {
parent::configure();

$this
Expand Down Expand Up @@ -98,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
* @param OutputInterface $output
* @param array $items
*/
protected function writeAppList(InputInterface $input, OutputInterface $output, $items) {
protected function writeAppList(InputInterface $input, OutputInterface $output, $items): void {
switch ($input->getOption('output')) {
case self::OUTPUT_FORMAT_PLAIN:
$output->writeln('Enabled:');
Expand All @@ -119,7 +119,7 @@ protected function writeAppList(InputInterface $input, OutputInterface $output,
* @param CompletionContext $context
* @return array
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
if ($optionName === 'shipped') {
return ['true', 'false'];
}
Expand All @@ -131,7 +131,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
* @param CompletionContext $context
* @return string[]
*/
public function completeArgumentValues($argumentName, CompletionContext $context) {
public function completeArgumentValues($argumentName, CompletionContext $context): array {
return [];
}
}
6 changes: 3 additions & 3 deletions core/Command/App/Remove.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(
parent::__construct();
}

protected function configure() {
protected function configure(): void {
$this
->setName('app:remove')
->setDescription('remove an app')
Expand Down Expand Up @@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
* @param CompletionContext $context
* @return string[]
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
return [];
}

Expand All @@ -133,7 +133,7 @@ public function completeOptionValues($optionName, CompletionContext $context) {
* @param CompletionContext $context
* @return string[]
*/
public function completeArgumentValues($argumentName, CompletionContext $context) {
public function completeArgumentValues($argumentName, CompletionContext $context): array {
if ($argumentName === 'app-id') {
return \OC_App::getAllApps();
}
Expand Down
2 changes: 1 addition & 1 deletion core/Command/App/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
parent::__construct();
}

protected function configure() {
protected function configure(): void {
$this
->setName('app:update')
->setDescription('update an app or all apps')
Expand Down
Loading