diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1912d4a..25e51d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,10 @@ jobs: phpunit: '^9' - php-version: '8.2' phpunit: '^9' + - php-version: '8.3' + phpunit: '^9' + - php-version: '8.4' + phpunit: '^9' name: PHP ${{ matrix.php-version }} steps: - name: Checkout diff --git a/Client.php b/Client.php index 227eab2..ffb336b 100755 --- a/Client.php +++ b/Client.php @@ -346,7 +346,7 @@ public function getSslMeta() * @param array|null $tlsOptions The TLS/SSL context options. See https://www.php.net/manual/en/context.ssl.php for details * @throws CredisException */ - public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $persistent = '', $db = 0, $password = null, $username = null, array $tlsOptions = null) + public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $persistent = '', $db = 0, $password = null, $username = null, $tlsOptions = null) { $this->host = (string)$host; if ($port !== null) { @@ -360,7 +360,7 @@ public function __construct($host = '127.0.0.1', $port = 6379, $timeout = null, $this->authUsername = $username; $this->selectedDb = (int)$db; $this->convertHost(); - if ($tlsOptions) { + if (is_array($tlsOptions) && count($tlsOptions) !== 0) { $this->setTlsOptions($tlsOptions); } // PHP Redis extension support TLS/ACL AUTH since 5.3.0