From 4ea8254c9cb3e35d38f186dd820b5d6be89d8b1f Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Fri, 12 Jun 2026 16:09:22 +0200 Subject: [PATCH 1/2] Fix lock scripts and CS Fixer config - Replace unsafe cat/herestring redirection with jq > .tmp && mv pattern to avoid truncating composer.json before jq reads it - Fix jq expression in lock-symfony-version.sh: use .key as $k to avoid indexing a string with .key after a pipe - Remove tests/ from .php-cs-fixer.dist.php (directory no longer exists) Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/lock-behat-version.sh | 2 +- .github/workflows/lock-symfony-version.sh | 4 ++-- .php-cs-fixer.dist.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lock-behat-version.sh b/.github/workflows/lock-behat-version.sh index b7e2dce..772af8c 100755 --- a/.github/workflows/lock-behat-version.sh +++ b/.github/workflows/lock-behat-version.sh @@ -1,3 +1,3 @@ #!/bin/bash -cat <<< $(jq --indent 4 --arg version "$VERSION" '.require |= with_entries(if (.key == "behat/behat") then .value=$version else . end)' < composer.json) > composer.json +jq --indent 4 --arg version "$VERSION" '.require |= with_entries(if (.key == "behat/behat") then .value=$version else . end)' < composer.json > composer.json.tmp && mv composer.json.tmp composer.json diff --git a/.github/workflows/lock-symfony-version.sh b/.github/workflows/lock-symfony-version.sh index be030fb..8842ee4 100755 --- a/.github/workflows/lock-symfony-version.sh +++ b/.github/workflows/lock-symfony-version.sh @@ -1,4 +1,4 @@ #!/bin/bash -cat <<< $(jq --indent 4 --arg version $VERSION '.require |= with_entries(if (.key|test("^symfony/") and (.key|test("-contracts$") | not)) then .value=$version else . end)' < composer.json) > composer.json -cat <<< $(jq --indent 4 --arg version $VERSION '."require-dev" |= with_entries(if (.key|test("^symfony/") and (.key|test("-contracts$") | not)) then .value=$version else . end)' < composer.json) > composer.json +jq --indent 4 --arg version "$VERSION" '.require |= with_entries(.key as $k | if ($k | test("^symfony/")) and ($k | test("-contracts$") | not) then .value=$version else . end)' < composer.json > composer.json.tmp && mv composer.json.tmp composer.json +jq --indent 4 --arg version "$VERSION" '."require-dev" |= with_entries(.key as $k | if ($k | test("^symfony/")) and ($k | test("-contracts$") | not) then .value=$version else . end)' < composer.json > composer.json.tmp && mv composer.json.tmp composer.json diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index dbaf6f8..c8d5c6c 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,7 +6,7 @@ use PhpCsFixer\Finder; $finder = Finder::create() - ->in([__DIR__ . '/src', __DIR__ . '/tests']) + ->in([__DIR__ . '/src']) ; return (new Config()) From 155d8d244b105f0584fa6a25b4da162e2a76d29d Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Fri, 12 Jun 2026 16:15:19 +0200 Subject: [PATCH 2/2] Fix CI matrix and Behat 4 compatibility - Use PHP attributes in FeatureContext (Behat 4 dropped docblock support) - Remove Behat 3.31 + Symfony 8.x combos (incompatible: Behat 3.31 requires symfony/config ^5.4||^6.4||^7.0) - Remove PHP 8.3 + Symfony 8.x combos (Symfony 8.0+ requires PHP >=8.4) - Add PHP 8.5 to stable (Behat 3.31 + Symfony 7.4) and all Behat 4 rows Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/build.yml | 23 +++++++++++++++-------- features/importing_files.feature | 20 ++++++++------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eba260a..ceba818 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,45 +19,52 @@ jobs: strategy: fail-fast: false matrix: + # Behat 3.31 only supports symfony/config ^5.4||^6.4||^7.0, so only Symfony 7.4 here php-version: - '8.3' - '8.4' + - '8.5' symfony-version: - '7.4.*' - - '8.0.*' - - '8.1.*' behat-version: - '3.31.*' experimental: - false include: + # Behat 4 + Symfony 7.4 (all PHP versions) - php-version: '8.3' symfony-version: '7.4.*' behat-version: '4.x-dev as 4.0.0' experimental: true - - php-version: '8.3' - symfony-version: '8.0.*' + php-version: '8.4' + symfony-version: '7.4.*' behat-version: '4.x-dev as 4.0.0' experimental: true - - php-version: '8.3' - symfony-version: '8.1.*' + php-version: '8.5' + symfony-version: '7.4.*' behat-version: '4.x-dev as 4.0.0' experimental: true + # Behat 4 + Symfony 8.x requires PHP >=8.4 - php-version: '8.4' - symfony-version: '7.4.*' + symfony-version: '8.0.*' behat-version: '4.x-dev as 4.0.0' experimental: true - php-version: '8.4' + symfony-version: '8.1.*' + behat-version: '4.x-dev as 4.0.0' + experimental: true + - + php-version: '8.5' symfony-version: '8.0.*' behat-version: '4.x-dev as 4.0.0' experimental: true - - php-version: '8.4' + php-version: '8.5' symfony-version: '8.1.*' behat-version: '4.x-dev as 4.0.0' experimental: true diff --git a/features/importing_files.feature b/features/importing_files.feature index ec4293f..2a47dea 100644 --- a/features/importing_files.feature +++ b/features/importing_files.feature @@ -19,25 +19,21 @@ Feature: Importing files $this->parameter = $parameter; } - /** - * @Given the parameter was injected to the context - */ - public function theParameterWasInjectedToTheContext() + #[\Behat\Step\Given('the parameter was injected to the context')] + public function theParameterWasInjectedToTheContext(): void { if (null === $this->parameter) { throw new \DomainException('No parameter was injected (or null one)!'); } } - /** - * @Then it should contain :content - */ - public function itShouldContain($content) - { - if ($content !== $this->parameter) { + #[\Behat\Step\Then('it should contain :content')] + public function itShouldContain(string $content): void + { + if ($content !== $this->parameter) { throw new \DomainException(sprintf('Expected to get "%s", got "%s"!', $content, $this->parameter)); - } - } + } + } } """ And a feature file "features/my.feature" containing: