diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f007759..1a14194 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: php-version: ['7.4', '8.0', '8.1', '8.2'] - rts-version: ['1.4.13', '1.6.19', '1.8.10'] + rts-version: ['1.4.13', '1.6.19', '1.8.12'] steps: - uses: actions/checkout@v3 - uses: adambirds/docker-compose-action@v1.3.0 diff --git a/Dockerfile b/Dockerfile index 4461bc2..7c81514 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,9 @@ RUN apt-get -y upgrade && \ apt-get update && \ apt-get install -yqq zip git wget -RUN pecl install igbinary redis ${XDEBUG_PACKAGE} && \ - docker-php-ext-enable igbinary redis xdebug +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && \ + install-php-extensions igbinary redis xdebug RUN wget https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar -q && \ mv composer.phar /usr/bin/composer && \ diff --git a/docker-compose.yml b/docker-compose.yml index 365e605..415c881 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,10 @@ services: dockerfile: Dockerfile context: . args: - PHP_VERSION: ${PHP_VERSION} + PHP_VERSION: ${PHP_VERSION-7.4} entrypoint: sleep infinity volumes: - .:/app - ./docker/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini php-rts-redis: - image: redislabs/redistimeseries:${RTS_VERSION} + image: redislabs/redistimeseries:${RTS_VERSION-1.4.13} diff --git a/run_ci.sh b/run_ci.sh index 31da221..903dac8 100755 --- a/run_ci.sh +++ b/run_ci.sh @@ -4,4 +4,4 @@ set -e composer install --no-progress --prefer-dist --optimize-autoloader ./vendor/bin/phpunit --coverage-text -#./vendor/bin/psalm +./vendor/bin/psalm diff --git a/src/Client/RedisClient.php b/src/Client/RedisClient.php index e46185d..18d9481 100644 --- a/src/Client/RedisClient.php +++ b/src/Client/RedisClient.php @@ -90,8 +90,8 @@ public function executeCommand(array $params) private function authenticate(?string $username, ?string $password): void { try { - if ($password) { - if ($username) { + if ($password !== null) { + if ($username !== null) { // Calling auth() with an array throws a TypeError in some cases /** * @noinspection PhpMethodParametersCountMismatchInspection @@ -104,13 +104,16 @@ private function authenticate(?string $username, ?string $password): void } if ($result === false) { throw new RedisAuthenticationException(sprintf( - 'Failure authenticating user %s', $username ?: 'default' + 'Failure authenticating user %s', + $username === null ? 'default' : $username )); } } } /** @noinspection PhpRedundantCatchClauseInspection */ catch (RedisException $e) { throw new RedisAuthenticationException(sprintf( - 'Failure authenticating user %s: %s', $username ?: 'default', $e->getMessage() + 'Failure authenticating user %s: %s', + $username === null ? 'default' : $username, + $e->getMessage() )); } }