diff options
Diffstat (limited to 'apps/updatenotification/lib/UpdateChecker.php')
-rw-r--r-- | apps/updatenotification/lib/UpdateChecker.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/updatenotification/lib/UpdateChecker.php b/apps/updatenotification/lib/UpdateChecker.php index cabdfe8b9ff..5f2712423d2 100644 --- a/apps/updatenotification/lib/UpdateChecker.php +++ b/apps/updatenotification/lib/UpdateChecker.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -40,18 +41,18 @@ class UpdateChecker { /** * @return array */ - public function getUpdateState() { + public function getUpdateState(): array { $data = $this->updater->check(); $result = []; - if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { + if (isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { $result['updateAvailable'] = true; $result['updateVersion'] = $data['versionstring']; $result['updaterEnabled'] = $data['autoupdater'] === '1'; - if(substr($data['web'], 0, 8) === 'https://') { + if (strpos($data['web'], 'https://') === 0) { $result['updateLink'] = $data['web']; } - if(substr($data['url'], 0, 8) === 'https://') { + if (strpos($data['url'], 'https://') === 0) { $result['downloadLink'] = $data['url']; } @@ -68,7 +69,7 @@ class UpdateChecker { $data['array']['oc_updateState'] = json_encode([ 'updateAvailable' => true, 'updateVersion' => $this->getUpdateState()['updateVersion'], - 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', + 'updateLink' => $this->getUpdateState()['updateLink'] ?? '', ]); } } |