Skip to content

Commit

Permalink
Correct return types in HTTP methods
Browse files Browse the repository at this point in the history
  • Loading branch information
patmr7 committed Nov 14, 2024
1 parent 86fcb9f commit 8018929
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions local/o365/classes/httpclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ protected function get_moodle_version(): string {
* @param string $url
* @param array|string $params
* @param array $options
* @return bool
* @return mixed
*/
public function patch($url, $params = '', $options = []): bool {
public function patch($url, $params = '', $options = []): mixed {
$options['CURLOPT_CUSTOMREQUEST'] = 'PATCH';

if (is_array($params)) {
Expand Down Expand Up @@ -125,9 +125,9 @@ public function patch($url, $params = '', $options = []): bool {
* @param string $url
* @param array|string $params
* @param array $options
* @return bool
* @return mixed
*/
public function merge($url, $params = '', $options = []): bool {
public function merge($url, $params = '', $options = []): mixed {
$options['CURLOPT_CUSTOMREQUEST'] = 'MERGE';

if (is_array($params)) {
Expand Down Expand Up @@ -155,9 +155,9 @@ public function merge($url, $params = '', $options = []): bool {
* @param string $url
* @param array $params
* @param array $options
* @return bool
* @return mixed
*/
public function put($url, $params = [], $options = []): bool {
public function put($url, $params = [], $options = []): mixed {
if (!isset($params['file'])) {
throw new moodle_exception('errorhttpclientnofileinput', 'local_o365');
}
Expand Down Expand Up @@ -188,9 +188,9 @@ public function put($url, $params = [], $options = []): bool {
*
* @param string $url
* @param array $options
* @return bool
* @return mixed
*/
public function download_file($url, $options = []): bool {
public function download_file($url, $options = []): mixed {
$url = str_replace(['+', ' '], '%20', $url);

return $this->request($url, $options);
Expand Down

0 comments on commit 8018929

Please sign in to comment.