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

fix(ex_app_fetcher): use new OCP ServerVersion #400

Merged
merged 3 commits into from
Sep 26, 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
6 changes: 4 additions & 2 deletions lib/Fetcher/AppAPIFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use OCP\Files\NotPermittedException;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\ServerVersion;
use OCP\Support\Subscription\IRegistry;
use Psr\Log\LoggerInterface;

Expand All @@ -35,7 +36,8 @@ public function __construct(
protected ITimeFactory $timeFactory,
protected IConfig $config,
protected LoggerInterface $logger,
protected IRegistry $registry
protected IRegistry $registry,
protected ServerVersion $serverVersion,
) {
$this->appData = $appDataFactory->get('appstore');
}
Expand Down Expand Up @@ -184,7 +186,7 @@ public function setVersion(string $version): void {
*/
protected function getChannel(): string {
if ($this->channel === null) {
$this->channel = \OC_Util::getChannel();
$this->channel = $this->serverVersion->getChannel();
}
return $this->channel;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/Fetcher/ExAppFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\ServerVersion;
use OCP\Support\Subscription\IRegistry;
use Psr\Log\LoggerInterface;

Expand All @@ -26,15 +27,17 @@ public function __construct(
IConfig $config,
CompareVersion $compareVersion,
LoggerInterface $logger,
protected IRegistry $registry
protected IRegistry $registry,
protected ServerVersion $serverVersion,
) {
parent::__construct(
$appDataFactory,
$clientService,
$timeFactory,
$config,
$logger,
$registry
$registry,
$serverVersion
);

$this->compareVersion = $compareVersion;
Expand Down
6 changes: 4 additions & 2 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<file src="lib/AppInfo/Application.php">
<InvalidArgument>
<code><![CDATA[LoadFilesPluginListener::class]]></code>
Expand Down Expand Up @@ -54,10 +54,11 @@
<UndefinedClass>
<code><![CDATA[$appDataFactory]]></code>
<code><![CDATA[$e]]></code>
<code><![CDATA[$this->serverVersion]]></code>
<code><![CDATA[ConnectException]]></code>
<code><![CDATA[ConnectException]]></code>
<code><![CDATA[Factory]]></code>
<code><![CDATA[\OC_Util]]></code>
<code><![CDATA[protected]]></code>
</UndefinedClass>
</file>
<file src="lib/Fetcher/ExAppFetcher.php">
Expand All @@ -72,6 +73,7 @@
<code><![CDATA[CompareVersion]]></code>
<code><![CDATA[Factory]]></code>
<code><![CDATA[VersionParser]]></code>
<code><![CDATA[protected]]></code>
</UndefinedClass>
</file>
<file src="lib/Listener/FileEventsListener.php">
Expand Down
Loading