From 4c2180b36da10af33cbe80e6766c6aecb0dd6f18 Mon Sep 17 00:00:00 2001 From: Patryk Mroczko Date: Mon, 18 Nov 2024 17:48:51 +0100 Subject: [PATCH] Change return types in HTTP methods --- local/o365/classes/httpclient.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/local/o365/classes/httpclient.php b/local/o365/classes/httpclient.php index 4780cd53c..d28396b0a 100644 --- a/local/o365/classes/httpclient.php +++ b/local/o365/classes/httpclient.php @@ -95,9 +95,9 @@ protected function get_moodle_version(): string { * @param string $url * @param array|string $params * @param array $options - * @return bool + * @return bool|string */ - public function patch($url, $params = '', $options = []): bool { + public function patch($url, $params = '', $options = []): bool|string { $options['CURLOPT_CUSTOMREQUEST'] = 'PATCH'; if (is_array($params)) { @@ -125,9 +125,9 @@ public function patch($url, $params = '', $options = []): bool { * @param string $url * @param array|string $params * @param array $options - * @return bool + * @return bool|string */ - public function merge($url, $params = '', $options = []): bool { + public function merge($url, $params = '', $options = []): bool|string { $options['CURLOPT_CUSTOMREQUEST'] = 'MERGE'; if (is_array($params)) { @@ -155,9 +155,9 @@ public function merge($url, $params = '', $options = []): bool { * @param string $url * @param array $params * @param array $options - * @return bool + * @return bool|string */ - public function put($url, $params = [], $options = []): bool { + public function put($url, $params = [], $options = []): bool|string { if (!isset($params['file'])) { throw new moodle_exception('errorhttpclientnofileinput', 'local_o365'); } @@ -188,9 +188,9 @@ public function put($url, $params = [], $options = []): bool { * * @param string $url * @param array $options - * @return bool + * @return bool|string */ - public function download_file($url, $options = []): bool { + public function download_file($url, $options = []): bool|string { $url = str_replace(['+', ' '], '%20', $url); return $this->request($url, $options);