From ac460d30abf895f44b78abbf0ab584db22c03fe9 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 5 Mar 2026 19:39:47 +0100 Subject: [PATCH 1/2] Update CI workflows and add PHPStan Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/checks.yml | 4 ++-- .github/workflows/ci.yml | 10 ++++----- .github/workflows/static.yml | 29 ++++++++++++++++++++++++--- phpstan-baseline.neon | 25 +++++++++++++++++++++++ phpstan.neon.dist | 7 +++++++ src/ServiceClient.php | 4 ++-- vendor-bin/php-cs-fixer/composer.json | 4 ++-- vendor-bin/phpstan/composer.json | 10 +++++++++ 8 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 phpstan-baseline.neon create mode 100644 phpstan.neon.dist create mode 100644 vendor-bin/phpstan/composer.json diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index aa01ed0..096c8b9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,11 +11,11 @@ permissions: jobs: composer-normalize: name: Composer Normalize - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Composer normalize uses: docker://ergebnis/composer-normalize-action diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33331ba..ecbb271 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ permissions: jobs: build-lowest-version: name: Build lowest version - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Set up PHP @@ -23,7 +23,7 @@ jobs: extensions: mbstring - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install dependencies run: composer update --no-interaction --prefer-stable --prefer-lowest --no-progress @@ -33,11 +33,11 @@ jobs: build: name: Build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: max-parallel: 10 matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Set up PHP @@ -49,7 +49,7 @@ jobs: extensions: mbstring - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install dependencies run: composer update --no-interaction --no-progress diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 84e6c46..aea3462 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -9,13 +9,37 @@ permissions: contents: read jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-24.04 + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + coverage: none + extensions: mbstring + + - name: Download dependencies + run: composer update --no-interaction --no-progress + + - name: Download PHPStan + run: composer bin phpstan update --no-interaction --no-progress + + - name: Execute PHPStan + run: vendor/bin/phpstan analyze --no-progress + php-cs-fixer: name: PHP-CS-Fixer - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -23,7 +47,6 @@ jobs: php-version: '7.4' coverage: none extensions: mbstring - tools: composer - name: Download dependencies run: composer update --no-interaction --no-progress diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..86179a4 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,25 @@ +parameters: + ignoreErrors: + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue + count: 1 + path: src/Command.php + + - + message: '#^Callable callable\(Psr\\Http\\Message\\RequestInterface, array\)\: GuzzleHttp\\Promise\\PromiseInterface invoked with 1 parameter, 2 required\.$#' + identifier: arguments.count + count: 1 + path: src/ServiceClient.php + + - + message: '#^Parameter \#1 of callable callable\(Psr\\Http\\Message\\RequestInterface, array\)\: GuzzleHttp\\Promise\\PromiseInterface expects Psr\\Http\\Message\\RequestInterface, GuzzleHttp\\Command\\CommandInterface given\.$#' + identifier: argument.type + count: 1 + path: src/ServiceClient.php + + - + message: '#^Ternary operator condition is always true\.$#' + identifier: ternary.alwaysTrue + count: 1 + path: src/ServiceClient.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..bc0f2c3 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,7 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: 5 + paths: + - src diff --git a/src/ServiceClient.php b/src/ServiceClient.php index 30a3480..e936677 100644 --- a/src/ServiceClient.php +++ b/src/ServiceClient.php @@ -153,9 +153,9 @@ public function __call($name, array $args) $command = $this->getCommand(substr($name, 0, -5), $args); return $this->executeAsync($command); - } else { - return $this->execute($this->getCommand($name, $args)); } + + return $this->execute($this->getCommand($name, $args)); } /** diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index aa16b02..bed2551 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { - "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "3.68.5" + "php": "^7.4", + "friendsofphp/php-cs-fixer": "3.94.2" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json new file mode 100644 index 0000000..b5002b7 --- /dev/null +++ b/vendor-bin/phpstan/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "php": "^8.2", + "phpstan/phpstan": "2.1.40", + "phpstan/phpstan-deprecation-rules": "2.0.3" + }, + "config": { + "preferred-install": "dist" + } +} From 5a884b1c5968cda0a3625352da125555a582132c Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 5 Mar 2026 20:01:09 +0100 Subject: [PATCH 2/2] Disable fail-fast on CI matrix jobs Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecbb271..5e75168 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,7 @@ jobs: name: Build runs-on: ubuntu-24.04 strategy: + fail-fast: false max-parallel: 10 matrix: php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']