Skip to content

Commit

Permalink
Transform query param into a body param.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 12, 2024
1 parent e2e9740 commit a47f2da
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions util/EndpointProxies/sql/closeCursorProxy.php
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;

0 comments on commit a47f2da

Please sign in to comment.