Skip to content

Commit

Permalink
Cast port to int when creating Relay instance (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
yatsukhnenko authored Nov 22, 2024
1 parent 53e70be commit 1033bcf
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,51 @@ jobs:

- name: Test benchmarks
run: composer run bench -- --runs=1

laravel:

name: Laravel
runs-on: ubuntu-latest
timeout-minutes: 5

services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 1s
--health-timeout 1s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: redis, relay
tools: composer
coverage: none

- name: Install Laravel installer
run: composer require laravel/installer --no-interaction --prefer-dist --optimize-autoloader

- name: Install Laravel example app
run: composer exec laravel new example-app

- name: Install Composer dependencies
working-directory: example-app
run: |
composer config repositories.cachewerk/relay path ${{ github.workspace }}
composer require cachewerk/relay @dev
- name: Make and run test command
working-directory: example-app
run: |
php artisan make:command VerifyRelay --no-interaction
sed -i 's|//|dump(\\CacheWerk\\Relay\\Laravel\\Relay::stats(), \\Illuminate\\Support\\Facades\\Redis::info());|' app/Console/Commands/VerifyRelay.php
REDIS_CLIENT=relay php artisan app:verify-relay
2 changes: 1 addition & 1 deletion src/Laravel/RelayConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function establishConnection($client, array $config)

$parameters = [
$this->formatHost($config),
$config['port'],
is_scalar($config['port']) ? (int) $config['port'] : 0,
Arr::get($config, 'timeout', 0.0),
$persistent ? Arr::get($config, 'persistent_id', null) : null,
Arr::get($config, 'retry_interval', 0),
Expand Down

0 comments on commit 1033bcf

Please sign in to comment.