diff options
Diffstat (limited to 'core/Command/Config/App/Base.php')
-rw-r--r-- | core/Command/Config/App/Base.php | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/core/Command/Config/App/Base.php b/core/Command/Config/App/Base.php index b40f7c9e48d..e90a8e78f5b 100644 --- a/core/Command/Config/App/Base.php +++ b/core/Command/Config/App/Base.php @@ -1,32 +1,23 @@ <?php + +declare(strict_types=1); /** - * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com> - * - * @author Joas Schilling <coding@schilljs.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OC\Core\Command\Config\App; -use OCP\IConfig; +use OC\Config\ConfigManager; +use OCP\IAppConfig; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; abstract class Base extends \OC\Core\Command\Base { - protected IConfig $config; + public function __construct( + protected IAppConfig $appConfig, + protected readonly ConfigManager $configManager, + ) { + parent::__construct(); + } /** * @param string $argumentName @@ -35,12 +26,12 @@ abstract class Base extends \OC\Core\Command\Base { */ public function completeArgumentValues($argumentName, CompletionContext $context) { if ($argumentName === 'app') { - return \OC_App::getAllApps(); + return $this->appConfig->getApps(); } if ($argumentName === 'name') { $appName = $context->getWordAtIndex($context->getWordIndex() - 1); - return $this->config->getAppKeys($appName); + return $this->appConfig->getKeys($appName); } return []; } |