-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform query param into a body param.
Signed-off-by: dblock <[email protected]>
- Loading branch information
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* Proxy function to closeCursor() to prevent BC break. | ||
* Proxy function to closeCursor() to prevent BC break. | ||
* This API will be removed in a future version. Use 'close' API instead. | ||
* Note that the SQL close API takes the cursor in the body. | ||
* | ||
* $params['cursor'] = (string) The cursor given by the server | ||
* | ||
* @param array{'cursor': string} $params Associative array of parameters | ||
* @return array | ||
*/ | ||
public function closeCursor(array $params = []) | ||
public function closeCursor(array $params): array | ||
{ | ||
return $this->close($params); | ||
$endpointBuilder = $this->endpoints; | ||
/** @var AbstractEndpoint $endpoint */ | ||
$endpoint = $endpointBuilder('Sql\Close'); | ||
$endpoint->setBody(array_filter([ | ||
'cursor' => $this->extractArgument($params, 'cursor'), | ||
])); | ||
$endpoint->setParams($params); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |