aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Remote/Instance.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Remote/Instance.php')
-rw-r--r--lib/private/Remote/Instance.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/Remote/Instance.php b/lib/private/Remote/Instance.php
index 4ae734521cf..10403af4ec7 100644
--- a/lib/private/Remote/Instance.php
+++ b/lib/private/Remote/Instance.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -46,7 +47,7 @@ class Instance implements IInstance {
}
/**
- * @return string The of of the remote server with protocol
+ * @return string The of the remote server with protocol
*/
public function getFullUrl() {
return $this->getProtocol() . '://' . $this->getUrl();
@@ -123,7 +124,13 @@ class Instance implements IInstance {
private function downloadStatus($url) {
try {
$request = $this->clientService->newClient()->get($url);
- return $request->getBody();
+ $content = $request->getBody();
+
+ // IResponse.getBody responds with null|resource if returning a stream response was requested.
+ // As that's not the case here, we can just ignore the psalm warning by adding an assertion.
+ assert(is_string($content));
+
+ return $content;
} catch (\Exception $e) {
return false;
}