From 7ae6920563c99e932844510ddf95b20b2039a25b Mon Sep 17 00:00:00 2001 From: mattiabasone Date: Tue, 13 May 2025 16:19:35 +0200 Subject: [PATCH 1/2] update CI workflows --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a013ceb..4ca2b98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,14 +10,25 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.3 coverage: none tools: composer:v2, cs2pr + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache composer dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-8.3-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-8.3-composer- + - run: composer update --no-progress - run: vendor/bin/phpcs -q --report=checkstyle | cs2pr @@ -29,11 +40,11 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] stable: [true] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -43,6 +54,17 @@ jobs: coverage: pcov tools: composer:v2 + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache composer dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- + - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - run: composer update --no-progress From a3f170005eb9e210aa12cc472ecec007a7426cbb Mon Sep 17 00:00:00 2001 From: mattiabasone Date: Tue, 13 May 2025 16:25:16 +0200 Subject: [PATCH 2/2] remove else branch --- src/Client.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Client.php b/src/Client.php index 79da936..6725789 100644 --- a/src/Client.php +++ b/src/Client.php @@ -341,17 +341,17 @@ protected function send(array $data, array $tags = []): void } catch (ConnectionException $e) { if ($this->throwConnectionExceptions) { throw $e; - } else { - trigger_error( - sprintf( - 'StatsD server connection failed (udp://%s:%d): %s', - $this->host, - $this->port, - $e->getMessage() - ), - E_USER_WARNING - ); } + + trigger_error( + sprintf( + 'StatsD server connection failed (udp://%s:%d): %s', + $this->host, + $this->port, + $e->getMessage() + ), + E_USER_WARNING + ); } } }