Skip to content

Commit

Permalink
fix(appstore): return if appstore is manually disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: camel case

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: log a debug log

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: typing

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf committed Sep 9, 2024
1 parent a2cfcf3 commit e64894d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/private/App/AppStore/Fetcher/AppFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,17 @@ public function setVersion(string $version, string $fileName = 'apps.json', bool
$this->ignoreMaxVersion = $ignoreMaxVersion;
}


public function get($allowUnstable = false) {
public function get(bool $allowUnstable = false): array {

Check failure

Code scanning / Psalm

MethodSignatureMismatch Error

Argument 1 of OC\App\AppStore\Fetcher\AppFetcher::get has wrong type 'bool', expecting '' as defined by OC\App\AppStore\Fetcher\Fetcher::get

Check failure on line 151 in lib/private/App/AppStore/Fetcher/AppFetcher.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

MethodSignatureMismatch

lib/private/App/AppStore/Fetcher/AppFetcher.php:151:27: MethodSignatureMismatch: Argument 1 of OC\App\AppStore\Fetcher\AppFetcher::get has wrong type 'bool', expecting '' as defined by OC\App\AppStore\Fetcher\Fetcher::get (see https://psalm.dev/042)
$allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git';

$appStoreEnabled = $this->config->getSystemValueBool('appstoreenabled', true);
$internetAvailable = $this->config->getSystemValueBool('has_internet_connection', true);

if (!$appStoreEnabled || !$internetAvailable)) {

Check failure

Code scanning / Psalm

ParseError Error

Syntax error, unexpected ')' on line 157

Check failure on line 157 in lib/private/App/AppStore/Fetcher/AppFetcher.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

ParseError

lib/private/App/AppStore/Fetcher/AppFetcher.php:157:48: ParseError: Syntax error, unexpected ')' on line 157 (see https://psalm.dev/173)
$this->logger->debug('AppStore is disabled or this instance has no Internet connection', ['app' => 'appstoreFetcher']);
return [];
}

$apps = parent::get($allowPreReleases);
if (empty($apps)) {
$this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']);
Expand Down

0 comments on commit e64894d

Please sign in to comment.