Skip to content

Commit

Permalink
PHP 8.4 compatibility (#1415)
Browse files Browse the repository at this point in the history
* Add PHP 8.4 to matrix

* Make compatible with PHP 8.4

Fixes #1413
  • Loading branch information
ruudk authored Nov 4, 2024
1 parent 34c2444 commit 7440931
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
php-version: [7.4, 8.0, 8.1, 8.2, 8.3]
php-version: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
os: [ubuntu-latest]
es-version: [8.14-SNAPSHOT]

Expand Down
8 changes: 4 additions & 4 deletions src/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function setHosts(array $hosts): ClientBuilder
*
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
*/
public function setApiKey(string $apiKey, string $id = null): ClientBuilder
public function setApiKey(string $apiKey, ?string $id = null): ClientBuilder
{
if (empty($id)) {
$this->apiKey = $apiKey;
Expand Down Expand Up @@ -272,7 +272,7 @@ public function setRetries(int $retries): ClientBuilder
* @param string $cert The name of a file containing a PEM formatted certificate
* @param string $password if the certificate requires a password
*/
public function setSSLCert(string $cert, string $password = null): ClientBuilder
public function setSSLCert(string $cert, ?string $password = null): ClientBuilder
{
$this->sslCert = [$cert, $password];
return $this;
Expand All @@ -295,7 +295,7 @@ public function setCABundle(string $cert): ClientBuilder
* @param string $key The name of a file containing a private SSL key
* @param string $password if the private key requires a password
*/
public function setSSLKey(string $key, string $password = null): ClientBuilder
public function setSSLKey(string $key, ?string $password = null): ClientBuilder
{
$this->sslKey = [$key, $password];
return $this;
Expand Down Expand Up @@ -469,4 +469,4 @@ protected function setOptions(ClientInterface $client, array $config, array $cli
$adapter = new $adapterClass;
return $adapter->setConfig($client, $config, $clientOptions);
}
}
}

0 comments on commit 7440931

Please sign in to comment.