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 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 + ); } } }