From c8eb1cd1e34e7cb53963fa2ceb53d580bce5e119 Mon Sep 17 00:00:00 2001
From: David Siegfried <ds.siegfried@gmail.com>
Date: Wed, 22 Mar 2023 12:49:17 +0100
Subject: [PATCH] prepare for studip-5.3

---
 classes/OAuth.class.php  |  6 +++---
 classes/OwncloudFile.php | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/classes/OAuth.class.php b/classes/OAuth.class.php
index 4fa1902..219dae2 100755
--- a/classes/OAuth.class.php
+++ b/classes/OAuth.class.php
@@ -10,10 +10,10 @@ class OAuth {
 
         $accessToken = self::getAccessToken();
         if (!$accessToken) {
-            throw new Exception(sprintf("No valid access token. Please refresh your connection to %s.", Config::get()->OWNCLOUD_NAME));
+            throw new \Exception(sprintf("No valid access token. Please refresh your connection to %s.", Config::get()->OWNCLOUD_NAME));
         }
 
-        $header[] = OwnCloudFolder::getAuthHeader();
+        $header[] = \OwnCloudFolder::getAuthHeader();
 
         $r = curl_init();
         curl_setopt($r, CURLOPT_URL, $url);
@@ -141,4 +141,4 @@ class OAuth {
         \UserConfig::get($GLOBALS['user']->id)->delete("OWNCLOUD_ACCESS_TOKEN");
         \UserConfig::get($GLOBALS['user']->id)->delete("OWNCLOUD_REFRESH_TOKEN");
     }
-}
\ No newline at end of file
+}
diff --git a/classes/OwncloudFile.php b/classes/OwncloudFile.php
index ce4c176..ef29aa3 100644
--- a/classes/OwncloudFile.php
+++ b/classes/OwncloudFile.php
@@ -108,7 +108,7 @@ class OwncloudFile implements FileType
      * on the server disk. Other implementations shall just return
      * an empty string.
      *
-     * @returns The file system path for the file or an empty string if the
+     * @returns string The file system path for the file or an empty string if the
      *     file doesn't have a path in the file system.
      */
     public function getPath() : string
@@ -339,7 +339,7 @@ class OwncloudFile implements FileType
 
         $content = curl_exec($r);
 
-        $info = curl_getinfo($r);
+        curl_getinfo($r);
         curl_close($r);
         $path = $GLOBALS['TMP_PATH']."/owncloudplugin_".md5(uniqid());
         file_put_contents(
@@ -438,15 +438,15 @@ class OwncloudFile implements FileType
             curl_setopt($r, CURLOPT_VERBOSE, true);
         }
         curl_exec($r);
-        $status = curl_getinfo($r, CURLINFO_HTTP_CODE);
+        curl_getinfo($r, CURLINFO_HTTP_CODE);
         curl_close($r);
         fclose($fh_res);
 
         return $this;
     }
 
-    public function getAccessibility(): bool
+    public function getAccessibility() : bool
     {
-        // TODO: Implement getAccessibility() method.
+        return false;
     }
 }
-- 
GitLab