-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
Signed-off-by: dblock <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,13 +169,27 @@ public function settings(array $params = []) | |
$endpoint->setBody($body); | ||
|
||
return $this->performRequest($endpoint); | ||
} | ||
/** | ||
} /** | ||
* 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'); | ||
Check failure on line 187 in src/OpenSearch/Namespaces/SqlNamespace.php GitHub Actions / PHPStan
Check failure on line 187 in src/OpenSearch/Namespaces/SqlNamespace.php GitHub Actions / PHPStan
|
||
$endpoint->setBody(array_filter([ | ||
Check failure on line 188 in src/OpenSearch/Namespaces/SqlNamespace.php GitHub Actions / PHPStan
|
||
'cursor' => $this->extractArgument($params, 'cursor'), | ||
])); | ||
$endpoint->setParams($params); | ||
Check failure on line 191 in src/OpenSearch/Namespaces/SqlNamespace.php GitHub Actions / PHPStan
|
||
|
||
return $this->performRequest($endpoint); | ||
Check failure on line 193 in src/OpenSearch/Namespaces/SqlNamespace.php GitHub Actions / PHPStan
Check failure on line 193 in src/OpenSearch/Namespaces/SqlNamespace.php GitHub Actions / PHPStan
|
||
} | ||
} |
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; |