Skip to content

Commit f64de78

Browse files
committed
Fix @return documentation of ODataClient and ODataRequest::execute()
This documents the return type change that was introduced with version 0.7.0.
1 parent d66784a commit f64de78

File tree

2 files changed

+39
-9
lines changed

2 files changed

+39
-9
lines changed

src/ODataClient.php

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ public function query()
219219
* @param string $requestUri
220220
* @param array $bindings
221221
*
222-
* @return IODataRequest
222+
* @return array of objects
223+
* .. of class $entityReturnType if $entityReturnType !== false
224+
* .. of class ODataResponse if $entityReturnType === false
223225
*/
224226
public function get($requestUri, $bindings = [])
225227
{
@@ -234,7 +236,12 @@ public function get($requestUri, $bindings = [])
234236
* @param array $bindings
235237
* @param array $skipToken
236238
*
237-
* @return IODataRequest
239+
* @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response
240+
* Otherwise: array with two values
241+
* - First value: array of objects
242+
* .. of class $entityReturnType if $entityReturnType !== false
243+
* .. of class ODataResponse if $entityReturnType === false
244+
* - Second value: string containing the "next link" URL
238245
*/
239246
public function getNextPage($requestUri, $bindings = [])
240247
{
@@ -273,7 +280,12 @@ public function cursor($requestUri, $bindings = [])
273280
* @param string $requestUri
274281
* @param mixed $postData
275282
*
276-
* @return IODataRequest
283+
* @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response
284+
* Otherwise: array with two values
285+
* - First value: array of objects
286+
* .. of class $entityReturnType if $entityReturnType !== false
287+
* .. of class ODataResponse if $entityReturnType === false
288+
* - Second value: string containing the "next link" URL
277289
*/
278290
public function post($requestUri, $postData)
279291
{
@@ -286,7 +298,12 @@ public function post($requestUri, $postData)
286298
* @param string $requestUri
287299
* @param mixed $body
288300
*
289-
* @return IODataRequest
301+
* @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response
302+
* Otherwise: array with two values
303+
* - First value: array of objects
304+
* .. of class $entityReturnType if $entityReturnType !== false
305+
* .. of class ODataResponse if $entityReturnType === false
306+
* - Second value: string containing the "next link" URL
290307
*/
291308
public function patch($requestUri, $body)
292309
{
@@ -298,7 +315,12 @@ public function patch($requestUri, $body)
298315
*
299316
* @param string $requestUri
300317
*
301-
* @return IODataRequest
318+
* @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response
319+
* Otherwise: array with two values
320+
* - First value: array of objects
321+
* .. of class $entityReturnType if $entityReturnType !== false
322+
* .. of class ODataResponse if $entityReturnType === false
323+
* - Second value: string containing the "next link" URL
302324
*/
303325
public function delete($requestUri)
304326
{
@@ -312,7 +334,12 @@ public function delete($requestUri)
312334
* @param string $requestUri
313335
* @param mixed $body
314336
*
315-
* @return IODataRequest
337+
* @return If $entityReturnType === 'stream': GuzzleHttp\Psr7\Response
338+
* Otherwise: array with two values
339+
* - First value: array of objects
340+
* .. of class $entityReturnType if $entityReturnType !== false
341+
* .. of class ODataResponse if $entityReturnType === false
342+
* - Second value: string containing the "next link" URL
316343
*
317344
* @throws ODataException
318345
*/

src/ODataRequest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,12 @@ public function setTimeout($timeout)
213213
*
214214
* @throws ODataException if response is invalid
215215
*
216-
* @return array array of objects
217-
* of class $returnType if $returnType !== false
218-
* of class ODataResponse if $returnType === false
216+
* @return If $returnType === 'stream': GuzzleHttp\Psr7\Response
217+
* Otherwise: array with two values
218+
* - First value: array of objects
219+
* .. of class $returnType if $returnType !== false
220+
* .. of class ODataResponse if $returnType === false
221+
* - Second value: string containing the "next link" URL
219222
*/
220223
public function execute()
221224
{

0 commit comments

Comments
 (0)