diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-03-06 11:54:58 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-22 12:14:58 +0200 |
commit | 644036ab4e3d1d6f175a485ed7ae4883c668ff48 (patch) | |
tree | c11aba914ce246805c420270d0e5bb828c58ee1a /core/Command/L10n | |
parent | 683dc07f06018e72e46f067a306dc14408ce91f9 (diff) | |
download | nextcloud-server-644036ab4e3d1d6f175a485ed7ae4883c668ff48.tar.gz nextcloud-server-644036ab4e3d1d6f175a485ed7ae4883c668ff48.zip |
fix: Migrate away from OC_App toward the IAppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core/Command/L10n')
-rw-r--r-- | core/Command/L10n/CreateJs.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/Command/L10n/CreateJs.php b/core/Command/L10n/CreateJs.php index 6472e7aec1c..724e94f28d5 100644 --- a/core/Command/L10n/CreateJs.php +++ b/core/Command/L10n/CreateJs.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -26,6 +29,7 @@ namespace OC\Core\Command\L10n; use DirectoryIterator; +use OCP\App\IAppManager; use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Symfony\Component\Console\Command\Command; @@ -35,6 +39,12 @@ use Symfony\Component\Console\Output\OutputInterface; use UnexpectedValueException; class CreateJs extends Command implements CompletionAwareInterface { + public function __construct( + protected IAppManager $appManager, + ) { + parent::__construct(); + } + protected function configure() { $this ->setName('l10n:createjs') @@ -55,11 +65,7 @@ class CreateJs extends Command implements CompletionAwareInterface { $app = $input->getArgument('app'); $lang = $input->getArgument('lang'); - $path = \OC_App::getAppPath($app); - if ($path === false) { - $output->writeln("The app <$app> is unknown."); - return 1; - } + $path = $this->appManager->getAppPath($app); $languages = $lang; if (empty($lang)) { $languages = $this->getAllLanguages($path); |