Skip to content

Commit 8f23d63

Browse files
committed
Prep. for 8.18.0
1 parent 2518470 commit 8f23d63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6756
-4933
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ util/doctum.phar
3535
# PHPUnit
3636
/phpunit.xml
3737
.phpunit.result.cache
38+
.phpunit.cache/
3839

3940
# Code coverage
4041
build

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"ext-yaml": "*",
2222
"ext-zip": "*",
2323
"mockery/mockery": "^1.5",
24-
"phpstan/phpstan": "^1.4",
24+
"phpstan/phpstan": "^2.1",
2525
"phpunit/phpunit": "^9.5",
2626
"symfony/finder": "~4.0",
2727
"nyholm/psr7": "^1.5",
@@ -51,7 +51,7 @@
5151
"vendor/bin/phpunit --testdox -c phpunit-integration-cloud-tests.xml"
5252
],
5353
"phpstan": [
54-
"phpstan analyse src --level 2 --no-progress --memory-limit 256M"
54+
"phpstan analyse --no-progress --memory-limit 256M"
5555
]
5656
},
5757
"config": {

phpstan.neon

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
parameters:
2+
level: 5
3+
paths:
4+
- src
5+
reportUnmatchedIgnoredErrors: false
26
ignoreErrors:
3-
- '#PHPDoc tag @param has invalid value#'
7+
- '#Offset ''body'' on array\{\}\|array\{#'
8+
- '#Access to an undefined property Elastic\\Elasticsearch\\Client::\$client.#'

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
final class Client implements ClientInterface
2929
{
3030
const CLIENT_NAME = 'es';
31-
const VERSION = '8.15.0';
31+
const VERSION = '8.18.0';
3232
const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
3333

3434
const SEARCH_ENDPOINTS = [

src/ClientBuilder.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function setHosts(array $hosts): ClientBuilder
226226
*
227227
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
228228
*/
229-
public function setApiKey(string $apiKey, string $id = null): ClientBuilder
229+
public function setApiKey(string $apiKey, ?string $id = null): ClientBuilder
230230
{
231231
if (empty($id)) {
232232
$this->apiKey = $apiKey;
@@ -272,7 +272,7 @@ public function setRetries(int $retries): ClientBuilder
272272
* @param string $cert The name of a file containing a PEM formatted certificate
273273
* @param string $password if the certificate requires a password
274274
*/
275-
public function setSSLCert(string $cert, string $password = null): ClientBuilder
275+
public function setSSLCert(string $cert, ?string $password = null): ClientBuilder
276276
{
277277
$this->sslCert = [$cert, $password];
278278
return $this;
@@ -295,7 +295,7 @@ public function setCABundle(string $cert): ClientBuilder
295295
* @param string $key The name of a file containing a private SSL key
296296
* @param string $password if the private key requires a password
297297
*/
298-
public function setSSLKey(string $key, string $password = null): ClientBuilder
298+
public function setSSLKey(string $key, ?string $password = null): ClientBuilder
299299
{
300300
$this->sslKey = [$key, $password];
301301
return $this;

src/Endpoints/AsyncSearch.php

+79-73
Large diffs are not rendered by default.

src/Endpoints/Autoscaling.php

+35-31
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class Autoscaling extends AbstractEndpoint
3535
*
3636
* @param array{
3737
* name: string, // (REQUIRED) the name of the autoscaling policy
38-
* master_timeout: time, // Timeout for processing on master node
39-
* timeout: time, // Timeout for acknowledgement of update from all nodes in cluster
40-
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
41-
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
42-
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
43-
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44-
* filter_path: list, // A comma-separated list of filters used to reduce the response.
38+
* master_timeout?: int|string, // Timeout for processing on master node
39+
* timeout?: int|string, // Timeout for acknowledgement of update from all nodes in cluster
40+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
41+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
42+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
43+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
4545
* } $params
4646
*
4747
* @throws MissingParameterException if a required parameter is missing
@@ -51,8 +51,9 @@ class Autoscaling extends AbstractEndpoint
5151
*
5252
* @return Elasticsearch|Promise
5353
*/
54-
public function deleteAutoscalingPolicy(array $params = [])
54+
public function deleteAutoscalingPolicy(?array $params = null)
5555
{
56+
$params = $params ?? [];
5657
$this->checkRequiredParameters(['name'], $params);
5758
$url = '/_autoscaling/policy/' . $this->encode($params['name']);
5859
$method = 'DELETE';
@@ -73,12 +74,12 @@ public function deleteAutoscalingPolicy(array $params = [])
7374
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html
7475
*
7576
* @param array{
76-
* master_timeout: time, // Timeout for processing on master node
77-
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
78-
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
79-
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
80-
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
81-
* filter_path: list, // A comma-separated list of filters used to reduce the response.
77+
* master_timeout?: int|string, // Timeout for processing on master node
78+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
79+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
80+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
81+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
82+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
8283
* } $params
8384
*
8485
* @throws NoNodeAvailableException if all the hosts are offline
@@ -87,8 +88,9 @@ public function deleteAutoscalingPolicy(array $params = [])
8788
*
8889
* @return Elasticsearch|Promise
8990
*/
90-
public function getAutoscalingCapacity(array $params = [])
91+
public function getAutoscalingCapacity(?array $params = null)
9192
{
93+
$params = $params ?? [];
9294
$url = '/_autoscaling/capacity';
9395
$method = 'GET';
9496

@@ -109,12 +111,12 @@ public function getAutoscalingCapacity(array $params = [])
109111
*
110112
* @param array{
111113
* name: string, // (REQUIRED) the name of the autoscaling policy
112-
* master_timeout: time, // Timeout for processing on master node
113-
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
114-
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
115-
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
116-
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
117-
* filter_path: list, // A comma-separated list of filters used to reduce the response.
114+
* master_timeout?: int|string, // Timeout for processing on master node
115+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
116+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
117+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
118+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
119+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
118120
* } $params
119121
*
120122
* @throws MissingParameterException if a required parameter is missing
@@ -124,8 +126,9 @@ public function getAutoscalingCapacity(array $params = [])
124126
*
125127
* @return Elasticsearch|Promise
126128
*/
127-
public function getAutoscalingPolicy(array $params = [])
129+
public function getAutoscalingPolicy(?array $params = null)
128130
{
131+
$params = $params ?? [];
129132
$this->checkRequiredParameters(['name'], $params);
130133
$url = '/_autoscaling/policy/' . $this->encode($params['name']);
131134
$method = 'GET';
@@ -147,14 +150,14 @@ public function getAutoscalingPolicy(array $params = [])
147150
*
148151
* @param array{
149152
* name: string, // (REQUIRED) the name of the autoscaling policy
150-
* master_timeout: time, // Timeout for processing on master node
151-
* timeout: time, // Timeout for acknowledgement of update from all nodes in cluster
152-
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
153-
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
154-
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
155-
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
156-
* filter_path: list, // A comma-separated list of filters used to reduce the response.
157-
* body: array, // (REQUIRED) the specification of the autoscaling policy
153+
* master_timeout?: int|string, // Timeout for processing on master node
154+
* timeout?: int|string, // Timeout for acknowledgement of update from all nodes in cluster
155+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
156+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
157+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
158+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
159+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
160+
* body: string|array<mixed>, // (REQUIRED) the specification of the autoscaling policy. If body is a string must be a valid JSON.
158161
* } $params
159162
*
160163
* @throws MissingParameterException if a required parameter is missing
@@ -164,8 +167,9 @@ public function getAutoscalingPolicy(array $params = [])
164167
*
165168
* @return Elasticsearch|Promise
166169
*/
167-
public function putAutoscalingPolicy(array $params = [])
170+
public function putAutoscalingPolicy(?array $params = null)
168171
{
172+
$params = $params ?? [];
169173
$this->checkRequiredParameters(['name','body'], $params);
170174
$url = '/_autoscaling/policy/' . $this->encode($params['name']);
171175
$method = 'PUT';

0 commit comments

Comments
 (0)