Merge pull request #39183 from shdehnavi/refactor_core_command_app

This commit is contained in:
John Molakvoæ 2024-02-23 19:46:29 +01:00 committed by GitHub
commit f40c2a03b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 15 additions and 15 deletions

View file

@ -83,7 +83,7 @@ class Disable extends Command implements CompletionAwareInterface {
* @param CompletionContext $context
* @return string[]
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
return [];
}
@ -92,7 +92,7 @@ class Disable extends Command implements CompletionAwareInterface {
* @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());
}

View file

@ -146,7 +146,7 @@ class Enable extends Command implements CompletionAwareInterface {
* @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();
@ -160,7 +160,7 @@ class Enable extends Command implements CompletionAwareInterface {
* @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));

View file

@ -29,7 +29,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class GetPath extends Base {
protected function configure() {
protected function configure(): void {
parent::configure();
$this
@ -67,7 +67,7 @@ class GetPath extends Base {
* @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();
}

View file

@ -36,7 +36,7 @@ use Symfony\Component\Console\Input\InputOption;
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')

View file

@ -39,7 +39,7 @@ class ListApps extends Base {
parent::__construct();
}
protected function configure() {
protected function configure(): void {
parent::configure();
$this
@ -98,7 +98,7 @@ class ListApps extends Base {
* @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:');
@ -119,7 +119,7 @@ class ListApps extends Base {
* @param CompletionContext $context
* @return array
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
if ($optionName === 'shipped') {
return ['true', 'false'];
}
@ -131,7 +131,7 @@ class ListApps extends Base {
* @param CompletionContext $context
* @return string[]
*/
public function completeArgumentValues($argumentName, CompletionContext $context) {
public function completeArgumentValues($argumentName, CompletionContext $context): array {
return [];
}
}

View file

@ -47,7 +47,7 @@ class Remove extends Command implements CompletionAwareInterface {
parent::__construct();
}
protected function configure() {
protected function configure(): void {
$this
->setName('app:remove')
->setDescription('remove an app')
@ -124,7 +124,7 @@ class Remove extends Command implements CompletionAwareInterface {
* @param CompletionContext $context
* @return string[]
*/
public function completeOptionValues($optionName, CompletionContext $context) {
public function completeOptionValues($optionName, CompletionContext $context): array {
return [];
}
@ -133,7 +133,7 @@ class Remove extends Command implements CompletionAwareInterface {
* @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();
}

View file

@ -45,7 +45,7 @@ class Update extends Command {
parent::__construct();
}
protected function configure() {
protected function configure(): void {
$this
->setName('app:update')
->setDescription('update an app or all apps')