Skip to content

Commit

Permalink
Refactor OC\Server::getAppFetcher
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Summers <[email protected]>
  • Loading branch information
summersab committed Aug 30, 2023
1 parent 9d1547f commit db4404b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/private/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use OCP\ILogger;
use OCP\Util;
use OC\App\AppManager;
use OC\App\AppStore\Fetcher\AppFetcher;
use OC\DB\Connection;
use OC\DB\MigrationService;
use OC\DB\MigratorExecuteSqlEvent;
Expand Down Expand Up @@ -272,7 +273,7 @@ private function doUpgrade(string $currentVersion, string $installedVersion): vo
$this->doAppUpgrade();

// Update the appfetchers version so it downloads the correct list from the appstore
\OC::$server->getAppFetcher()->setVersion($currentVersion);
\OC::$server->get(AppFetcher::class)->setVersion($currentVersion);

/** @var AppManager $appManager */
$appManager = \OC::$server->getAppManager();
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function setUp(): void {
$this->appstore = $config->setSystemValue('appstoreenabled', true);
$config->setSystemValue('appstoreenabled', true);
$installer = new Installer(
\OC::$server->getAppFetcher(),
\OC::$server->get(AppFetcher::class),
\OC::$server->getHTTPClientService(),
\OC::$server->getTempManager(),
\OC::$server->get(LoggerInterface::class),
Expand All @@ -74,7 +74,7 @@ protected function getInstaller() {

protected function tearDown(): void {
$installer = new Installer(
\OC::$server->getAppFetcher(),
\OC::$server->get(AppFetcher::class),
\OC::$server->getHTTPClientService(),
\OC::$server->getTempManager(),
\OC::$server->get(LoggerInterface::class),
Expand All @@ -98,7 +98,7 @@ public function testInstallApp() {

// Install app
$installer = new Installer(
\OC::$server->getAppFetcher(),
\OC::$server->get(AppFetcher::class),
\OC::$server->getHTTPClientService(),
\OC::$server->getTempManager(),
\OC::$server->get(LoggerInterface::class),
Expand Down

0 comments on commit db4404b

Please sign in to comment.