Skip to content

Commit

Permalink
Fix @return documentation of ODataClient and ODataRequest::execute()
Browse files Browse the repository at this point in the history
This documents the return type change that was introduced with version 0.7.0.
  • Loading branch information
cweiske committed Sep 29, 2023
1 parent c88701d commit 56d69c1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
39 changes: 33 additions & 6 deletions src/ODataClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
{
Expand All @@ -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 = [])
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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
*/
Expand Down
9 changes: 6 additions & 3 deletions src/ODataRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 56d69c1

Please sign in to comment.