Skip to content

Commit f72cae9

Browse files
authored
Added PHP 8.4 Support for Elasticsearch 6.8.x (#1420)
* Fix "Implicitly nullable parameter" deprecation in PHP 8.4 * GitHub Actions: Add PHP 8.4 version to the test matrix
1 parent d66d592 commit f72cae9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Elasticsearch/ClientBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public function setSniffOnStart(bool $sniffOnStart): ClientBuilder
394394
* @param null|string $password
395395
* @return $this
396396
*/
397-
public function setSSLCert(string $cert, string $password = null): ClientBuilder
397+
public function setSSLCert(string $cert, ?string $password = null): ClientBuilder
398398
{
399399
$this->sslCert = [$cert, $password];
400400

@@ -406,7 +406,7 @@ public function setSSLCert(string $cert, string $password = null): ClientBuilder
406406
* @param null|string $password
407407
* @return $this
408408
*/
409-
public function setSSLKey(string $key, string $password = null): ClientBuilder
409+
public function setSSLKey(string $key, ?string $password = null): ClientBuilder
410410
{
411411
$this->sslKey = [$key, $password];
412412

src/Elasticsearch/Connections/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function __construct(
174174
* @param \Elasticsearch\Transport $transport
175175
* @return mixed
176176
*/
177-
public function performRequest($method, $uri, $params = null, $body = null, $options = [], Transport $transport = null)
177+
public function performRequest($method, $uri, $params = null, $body = null, $options = [], ?Transport $transport = null)
178178
{
179179
if ($body !== null) {
180180
$body = $this->serializer->serialize($body);
@@ -226,7 +226,7 @@ public function getLastRequestInfo()
226226

227227
private function wrapHandler(callable $handler)
228228
{
229-
return function (array $request, Connection $connection, Transport $transport = null, $options) use ($handler) {
229+
return function (array $request, Connection $connection, ?Transport $transport = null, $options = []) use ($handler) {
230230

231231
$this->lastRequest = [];
232232
$this->lastRequest['request'] = $request;

src/Elasticsearch/Connections/ConnectionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ public function getLastRequestInfo();
112112
*/
113113
// @codingStandardsIgnoreStart
114114
// "Arguments with default values must be at the end of the argument list" - cannot change the interface
115-
public function performRequest(string $method, string $uri, ?array $params = [], $body = null, array $options = [], Transport $transport = null);
115+
public function performRequest(string $method, string $uri, ?array $params = [], $body = null, array $options = [], ?Transport $transport = null);
116116
// @codingStandardsIgnoreEnd
117117
}

0 commit comments

Comments
 (0)