Skip to content

Commit

Permalink
Make compatible with PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ruudk authored Oct 31, 2024
1 parent 2d5167e commit 4a362b4
Showing 1 changed file with 4 additions and 4 deletions.
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 4a362b4

Please sign in to comment.