From 56d69c19c9f748b4d5d0f439cbc09fa11860f25f Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 29 Sep 2023 08:03:04 +0200 Subject: [PATCH] Fix @return documentation of ODataClient and ODataRequest::execute() This documents the return type change that was introduced with version 0.7.0. --- src/ODataClient.php | 39 +++++++++++++++++++++++++++++++++------ src/ODataRequest.php | 9 ++++++--- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/ODataClient.php b/src/ODataClient.php index c3b0e1b..536ac54 100644 --- a/src/ODataClient.php +++ b/src/ODataClient.php @@ -219,7 +219,9 @@ public function query() * @param string $requestUri * @param array $bindings * - * @return IODataRequest + * @return array of objects + * .. of class $entityReturnType if $entityReturnType !== false + * .. of class ODataResponse if $entityReturnType === false */ public function get($requestUri, $bindings = []) { @@ -234,7 +236,12 @@ public function get($requestUri, $bindings = []) * @param array $bindings * @param array $skipToken * - * @return IODataRequest + * @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response + * Otherwise: array with two values + * - First value: array of objects + * .. of class $entityReturnType if $entityReturnType !== false + * .. of class ODataResponse if $entityReturnType === false + * - Second value: string containing the "next link" URL */ public function getNextPage($requestUri, $bindings = []) { @@ -273,7 +280,12 @@ public function cursor($requestUri, $bindings = []) * @param string $requestUri * @param mixed $postData * - * @return IODataRequest + * @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response + * Otherwise: array with two values + * - First value: array of objects + * .. of class $entityReturnType if $entityReturnType !== false + * .. of class ODataResponse if $entityReturnType === false + * - Second value: string containing the "next link" URL */ public function post($requestUri, $postData) { @@ -286,7 +298,12 @@ public function post($requestUri, $postData) * @param string $requestUri * @param mixed $body * - * @return IODataRequest + * @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response + * Otherwise: array with two values + * - First value: array of objects + * .. of class $entityReturnType if $entityReturnType !== false + * .. of class ODataResponse if $entityReturnType === false + * - Second value: string containing the "next link" URL */ public function patch($requestUri, $body) { @@ -298,7 +315,12 @@ public function patch($requestUri, $body) * * @param string $requestUri * - * @return IODataRequest + * @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response + * Otherwise: array with two values + * - First value: array of objects + * .. of class $entityReturnType if $entityReturnType !== false + * .. of class ODataResponse if $entityReturnType === false + * - Second value: string containing the "next link" URL */ public function delete($requestUri) { @@ -312,7 +334,12 @@ public function delete($requestUri) * @param string $requestUri * @param mixed $body * - * @return IODataRequest + * @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response + * Otherwise: array with two values + * - First value: array of objects + * .. of class $entityReturnType if $entityReturnType !== false + * .. of class ODataResponse if $entityReturnType === false + * - Second value: string containing the "next link" URL * * @throws ODataException */ diff --git a/src/ODataRequest.php b/src/ODataRequest.php index f10fa21..88126f4 100644 --- a/src/ODataRequest.php +++ b/src/ODataRequest.php @@ -213,9 +213,12 @@ public function setTimeout($timeout) * * @throws ODataException if response is invalid * - * @return array array of objects - * of class $returnType if $returnType !== false - * of class ODataResponse if $returnType === false + * @return If $returnType === 'stream': GuzzleHttp\Psr7\Response + * Otherwise: array with two values + * - First value: array of objects + * .. of class $returnType if $returnType !== false + * .. of class ODataResponse if $returnType === false + * - Second value: string containing the "next link" URL */ public function execute() {