From 8a4e7cd5b6b283f1a4eabd62ddb2da8de37837b1 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 4 Oct 2025 13:45:57 +0200 Subject: [PATCH 01/50] Setup mutation testing --- .github/workflows/platform-test.yml | 11 +++++ composer.json | 4 +- infection.json5 | 15 ++++++ tests/Infection/TrinaryLogicMutator.php | 66 +++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 infection.json5 create mode 100644 tests/Infection/TrinaryLogicMutator.php diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 21f0d515..9b32d5e4 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -28,6 +28,9 @@ jobs: - "8.4" update-packages: - "" + run-infection: + - "" + include: - php-version: "8.1" update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 @@ -37,6 +40,8 @@ jobs: update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 - php-version: "8.4" update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 + - php-version: "8.4" + run-infection: "true" steps: - name: "Checkout" @@ -63,6 +68,12 @@ jobs: - name: "Run platform matrix test" run: vendor/bin/phpunit --group=platform + if: ${{ matrix.run-infection == '' }} + + - name: "Run infection" + run: vendor/bin/infection + #run: vendor/bin/infection --git-diff-filter=AM + if: ${{ matrix.run-infection != '' }} services: postgres: diff --git a/composer.json b/composer.json index 9185e8b9..e2da4f3c 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "doctrine/orm": "^2.16.0", "doctrine/persistence": "^2.2.1 || ^3.2", "gedmo/doctrine-extensions": "^3.8", + "infection/infection": "^0.31.2", "nesbot/carbon": "^2.49", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0.2", @@ -42,7 +43,8 @@ "config": { "sort-packages": true, "allow-plugins": { - "cweagans/composer-patches": true + "cweagans/composer-patches": true, + "infection/extension-installer": false } }, "extra": { diff --git a/infection.json5 b/infection.json5 new file mode 100644 index 00000000..1a25adf9 --- /dev/null +++ b/infection.json5 @@ -0,0 +1,15 @@ +{ + "$schema": "vendor/infection/infection/resources/schema.json", + "source": { + "directories": [ + "src" + ] + }, + "logs": { + "text": "tmp/infection.log" + }, + "mutators": { + "@default": false, + "PHPStan\\Infection\\TrinaryLogicMutator": true + } +} diff --git a/tests/Infection/TrinaryLogicMutator.php b/tests/Infection/TrinaryLogicMutator.php new file mode 100644 index 00000000..81d05dfc --- /dev/null +++ b/tests/Infection/TrinaryLogicMutator.php @@ -0,0 +1,66 @@ + + */ +final class TrinaryLogicMutator implements Mutator { + + public static function getDefinition(): Definition + { + return new Definition( + <<<'TXT' + Replaces TrinaryLogic->yes() with !TrinaryLogic->no() + TXT + , + MutatorCategory::ORTHOGONAL_REPLACEMENT, + null, + <<<'DIFF' + - $type->isBoolean()->yes(); + + !$type->isBoolean()->no(); + DIFF, + ); + } + + public function getName(): string + { + return 'TrinaryLogicMutator'; + } + + public function canMutate(Node $node): bool + { + if (!$node instanceof Node\Expr\MethodCall) { + return false; + } + + if (!$node->name instanceof Node\Identifier) { + return false; + } + + if (!in_array($node->name->name, ['yes', 'no'], true)) { + return false; + } + + return true; + } + + public function mutate(Node $node): iterable + { + if (!$node->name instanceof Node\Identifier) { + throw new LogicException(); + } + + if ($node->name->name === 'yes') { + yield new Node\Expr\BooleanNot(new Node\Expr\MethodCall($node->var, 'no')); + } else { + yield new Node\Expr\BooleanNot(new Node\Expr\MethodCall($node->var, 'yes')); + } + } +} From 65db2c81990e16c4b5ef869ff3cb7449c2bbf663 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 4 Oct 2025 13:55:07 +0200 Subject: [PATCH 02/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 9b32d5e4..85d236a8 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -49,12 +49,22 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" + if: ${{ matrix.run-infection == '' }} with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-file: development extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + if: ${{ matrix.run-infection != '' }} + with: + coverage: "xdebug" + php-version: "${{ matrix.php-version }}" + ini-file: development + extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb + - name: "Allow installing on PHP 8.4" if: matrix.php-version == '8.4' run: "composer config platform.php 8.3.99" From d3a6e604f1dbc28fca0cf0bf375b7ff8adddc818 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 4 Oct 2025 13:57:26 +0200 Subject: [PATCH 03/50] fix built --- .github/workflows/platform-test.yml | 1 + composer.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 85d236a8..a9bcf91c 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -42,6 +42,7 @@ jobs: update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 - php-version: "8.4" run-infection: "true" + update-packages: infection/infection steps: - name: "Checkout" diff --git a/composer.json b/composer.json index e2da4f3c..58a8b8db 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "doctrine/orm": "^2.16.0", "doctrine/persistence": "^2.2.1 || ^3.2", "gedmo/doctrine-extensions": "^3.8", - "infection/infection": "^0.31.2", "nesbot/carbon": "^2.49", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0.2", From 69b69cac203e92c013d722b236cb4cf7ebde4df5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 4 Oct 2025 14:00:52 +0200 Subject: [PATCH 04/50] fix build --- phpstan.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon b/phpstan.neon index eabc5225..d3d4ed49 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -23,6 +23,7 @@ parameters: - tests/*/data-attributes/* - tests/*/data-php-*/* - tests/Rules/Doctrine/ORM/entity-manager.php + - tests/Infection/ reportUnmatchedIgnoredErrors: false From baab8a3a3bc4dc0412b42cd4797a6cb88bfcc442 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 07:51:17 +0200 Subject: [PATCH 05/50] run infection in all test jobs --- .github/workflows/platform-test.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index a9bcf91c..87b08b58 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -28,8 +28,6 @@ jobs: - "8.4" update-packages: - "" - run-infection: - - "" include: - php-version: "8.1" @@ -40,9 +38,6 @@ jobs: update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 - php-version: "8.4" update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 - - php-version: "8.4" - run-infection: "true" - update-packages: infection/infection steps: - name: "Checkout" @@ -79,12 +74,10 @@ jobs: - name: "Run platform matrix test" run: vendor/bin/phpunit --group=platform - if: ${{ matrix.run-infection == '' }} - name: "Run infection" run: vendor/bin/infection #run: vendor/bin/infection --git-diff-filter=AM - if: ${{ matrix.run-infection != '' }} services: postgres: From b44bb9c200356f1eee48a7064db60cf0dd996a23 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 07:52:45 +0200 Subject: [PATCH 06/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 87b08b58..456f6339 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -52,15 +52,6 @@ jobs: ini-file: development extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - if: ${{ matrix.run-infection != '' }} - with: - coverage: "xdebug" - php-version: "${{ matrix.php-version }}" - ini-file: development - extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - - name: "Allow installing on PHP 8.4" if: matrix.php-version == '8.4' run: "composer config platform.php 8.3.99" @@ -75,6 +66,14 @@ jobs: - name: "Run platform matrix test" run: vendor/bin/phpunit --group=platform + - name: "Install Coverage driver" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-file: development + extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb + - name: "Run infection" run: vendor/bin/infection #run: vendor/bin/infection --git-diff-filter=AM From d223186f78db744c2d107602e30be501b2724379 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 07:53:09 +0200 Subject: [PATCH 07/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 456f6339..082ec582 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -45,7 +45,6 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" - if: ${{ matrix.run-infection == '' }} with: coverage: "none" php-version: "${{ matrix.php-version }}" From 843fbfe8bc68946ef642179f98ab6cde5d7925a5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 08:00:06 +0200 Subject: [PATCH 08/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 082ec582..fd96bfc3 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -74,7 +74,7 @@ jobs: extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - name: "Run infection" - run: vendor/bin/infection + run: make infection #run: vendor/bin/infection --git-diff-filter=AM services: From 7a2ece507d7e350bbd1d5047fdbd294155a785b4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 08:09:14 +0200 Subject: [PATCH 09/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index fd96bfc3..2612a933 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -66,6 +66,7 @@ jobs: run: vendor/bin/phpunit --group=platform - name: "Install Coverage driver" + if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' uses: "shivammathur/setup-php@v2" with: coverage: "pcov" @@ -74,6 +75,7 @@ jobs: extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - name: "Run infection" + if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' run: make infection #run: vendor/bin/infection --git-diff-filter=AM From 788a4507b3b7c5c47a76b47a157feb3abfd56501 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 08:09:20 +0200 Subject: [PATCH 10/50] cs --- tests/Infection/TrinaryLogicMutator.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Infection/TrinaryLogicMutator.php b/tests/Infection/TrinaryLogicMutator.php index 81d05dfc..b56e30f7 100644 --- a/tests/Infection/TrinaryLogicMutator.php +++ b/tests/Infection/TrinaryLogicMutator.php @@ -1,4 +1,4 @@ - */ -final class TrinaryLogicMutator implements Mutator { +final class TrinaryLogicMutator implements Mutator +{ public static function getDefinition(): Definition { @@ -63,4 +65,5 @@ public function mutate(Node $node): iterable yield new Node\Expr\BooleanNot(new Node\Expr\MethodCall($node->var, 'yes')); } } + } From 7517bac37e4634dae8971beeca5081ce74f8c155 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 08:23:40 +0200 Subject: [PATCH 11/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 2612a933..8b3b069b 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -66,7 +66,7 @@ jobs: run: vendor/bin/phpunit --group=platform - name: "Install Coverage driver" - if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' + if: matrix.update-packages != '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') uses: "shivammathur/setup-php@v2" with: coverage: "pcov" @@ -75,7 +75,7 @@ jobs: extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - name: "Run infection" - if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' + if: matrix.update-packages != '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') run: make infection #run: vendor/bin/infection --git-diff-filter=AM From 0cf316422924564966ec6ef93e602ecbc29935a2 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 5 Oct 2025 08:28:25 +0200 Subject: [PATCH 12/50] Update platform-test.yml --- .github/workflows/platform-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 8b3b069b..7988f703 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -66,7 +66,7 @@ jobs: run: vendor/bin/phpunit --group=platform - name: "Install Coverage driver" - if: matrix.update-packages != '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') + if: matrix.update-packages == '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') uses: "shivammathur/setup-php@v2" with: coverage: "pcov" @@ -75,7 +75,7 @@ jobs: extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - name: "Run infection" - if: matrix.update-packages != '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') + if: matrix.update-packages == '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') run: make infection #run: vendor/bin/infection --git-diff-filter=AM From 811f79d7e8c433bd983cdf34dba4d6a4fb9d886f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 12:10:47 +0200 Subject: [PATCH 13/50] Update build.yml --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17328a08..758d21fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -145,6 +145,43 @@ jobs: - name: "Tests" run: "make tests" + mutating-testing: + name: "Tests" + runs-on: "ubuntu-latest" + needs: "tests" + + strategy: + fail-fast: false + matrix: + php-version: + - "8.2" + - "8.3" + - "8.4" + + steps: + - name: "Checkout" + uses: actions/checkout@v5 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-file: development + extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb + + - name: "Allow installing on PHP 8.4" + if: matrix.php-version == '8.4' + run: "composer config platform.php 8.3.99" + + - name: "Install dependencies" + run: "composer install --no-interaction --no-progress" + + - name: "Run infection" + if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' + run: make infection + #run: vendor/bin/infection --git-diff-filter=AM + static-analysis: name: "PHPStan" runs-on: "ubuntu-latest" From cf457bbc11620a41ab79086552a12d59757d215a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 12:10:54 +0200 Subject: [PATCH 14/50] Discard changes to .github/workflows/platform-test.yml --- .github/workflows/platform-test.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/platform-test.yml b/.github/workflows/platform-test.yml index 7988f703..21f0d515 100644 --- a/.github/workflows/platform-test.yml +++ b/.github/workflows/platform-test.yml @@ -28,7 +28,6 @@ jobs: - "8.4" update-packages: - "" - include: - php-version: "8.1" update-packages: doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo/doctrine-extensions:^3 @@ -65,20 +64,6 @@ jobs: - name: "Run platform matrix test" run: vendor/bin/phpunit --group=platform - - name: "Install Coverage driver" - if: matrix.update-packages == '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-file: development - extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - - - name: "Run infection" - if: matrix.update-packages == '' && (matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4') - run: make infection - #run: vendor/bin/infection --git-diff-filter=AM - services: postgres: image: "postgres:latest" From 547569af761888396fc3a1b05044ae2459cc7045 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 12:11:28 +0200 Subject: [PATCH 15/50] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 758d21fe..b1c32e38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,7 +146,7 @@ jobs: run: "make tests" mutating-testing: - name: "Tests" + name: "Mutating Testing" runs-on: "ubuntu-latest" needs: "tests" From ba0c6b864781fce8d8ea68fde33e1338222c23c2 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 12:12:52 +0200 Subject: [PATCH 16/50] Update TrinaryLogicMutator.php --- tests/Infection/TrinaryLogicMutator.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Infection/TrinaryLogicMutator.php b/tests/Infection/TrinaryLogicMutator.php index b56e30f7..a68f35a2 100644 --- a/tests/Infection/TrinaryLogicMutator.php +++ b/tests/Infection/TrinaryLogicMutator.php @@ -19,15 +19,15 @@ public static function getDefinition(): Definition { return new Definition( <<<'TXT' - Replaces TrinaryLogic->yes() with !TrinaryLogic->no() - TXT + Replaces TrinaryLogic->yes() with !TrinaryLogic->no() + TXT , MutatorCategory::ORTHOGONAL_REPLACEMENT, null, <<<'DIFF' - - $type->isBoolean()->yes(); - + !$type->isBoolean()->no(); - DIFF, + - $type->isBoolean()->yes(); + + !$type->isBoolean()->no(); + DIFF, ); } From bcc667f9af0ac9412a67030f228e58bf8172ba68 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 13:57:04 +0200 Subject: [PATCH 17/50] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1c32e38..dca4442a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -145,8 +145,8 @@ jobs: - name: "Tests" run: "make tests" - mutating-testing: - name: "Mutating Testing" + mutation-testing: + name: "Mutation Testing" runs-on: "ubuntu-latest" needs: "tests" From 6075749c3c09d9a00e742ba7521ca86a0209d97d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 17:46:07 +0200 Subject: [PATCH 18/50] feedback --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dca4442a..1870c351 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,6 +169,7 @@ jobs: php-version: "${{ matrix.php-version }}" ini-file: development extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb + tools: infection - name: "Allow installing on PHP 8.4" if: matrix.php-version == '8.4' @@ -179,8 +180,7 @@ jobs: - name: "Run infection" if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' - run: make infection - #run: vendor/bin/infection --git-diff-filter=AM + run: vendor/bin/infection --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 static-analysis: name: "PHPStan" From 71c74c48cb696937c2e41da86b17908a613e71ef Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 17:48:07 +0200 Subject: [PATCH 19/50] Update build.yml --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1870c351..1c44377c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -180,7 +180,9 @@ jobs: - name: "Run infection" if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' - run: vendor/bin/infection --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 + run: | + git fetch --depth=1 origin $GITHUB_BASE_REF + infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 static-analysis: name: "PHPStan" From c180a99c23c5fb4bf3959353fd1d7a508ec883ae Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 17:48:26 +0200 Subject: [PATCH 20/50] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c44377c..55566644 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,7 +182,7 @@ jobs: if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' run: | git fetch --depth=1 origin $GITHUB_BASE_REF - infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 + infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 static-analysis: name: "PHPStan" From ae2e5ff29df014942730ef2f492bcdb480f036ef Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 17:52:16 +0200 Subject: [PATCH 21/50] Cannot pass both "--git-diff-lines" and "--git-diff-filter" options --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55566644..1a049861 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,7 +182,7 @@ jobs: if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' run: | git fetch --depth=1 origin $GITHUB_BASE_REF - infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 + infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 static-analysis: name: "PHPStan" From e6804409f7c91c51c6de7c2438bfbd7f6dad35b1 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 17:55:28 +0200 Subject: [PATCH 22/50] Update DoctrineTypeUtils.php --- src/Type/Doctrine/DoctrineTypeUtils.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Type/Doctrine/DoctrineTypeUtils.php b/src/Type/Doctrine/DoctrineTypeUtils.php index 43b0496d..426fe8ed 100644 --- a/src/Type/Doctrine/DoctrineTypeUtils.php +++ b/src/Type/Doctrine/DoctrineTypeUtils.php @@ -17,6 +17,7 @@ public static function getQueryBuilderTypes(Type $type): array { if ($type instanceof QueryBuilderType) { return [$type]; + // XXX test change - to be reverted } if ($type instanceof UnionType) { From 13980775b249af954f9ce2a1a24273178a1db7dc Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 17:59:00 +0200 Subject: [PATCH 23/50] Update composer.json --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 58a8b8db..9185e8b9 100644 --- a/composer.json +++ b/composer.json @@ -42,8 +42,7 @@ "config": { "sort-packages": true, "allow-plugins": { - "cweagans/composer-patches": true, - "infection/extension-installer": false + "cweagans/composer-patches": true } }, "extra": { From d1637c4806bc89e5d7f3f1318952be3d7c443f73 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 18:00:42 +0200 Subject: [PATCH 24/50] Update QueryBuilderDqlRule.php --- src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php b/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php index 69f9791a..abe9961b 100644 --- a/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php +++ b/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php @@ -58,7 +58,7 @@ public function processNode(Node $node, Scope $scope): array if (count($queryBuilderTypes) === 0) { if ( $this->reportDynamicQueryBuilders - && (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType)->yes() + && (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType)->yes() && true ) { return [ RuleErrorBuilder::message('Could not analyse QueryBuilder with unknown beginning.') From 80978eb64c492b0c156af12ce744eefcffe93f43 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 18:00:48 +0200 Subject: [PATCH 25/50] Update DoctrineTypeUtils.php --- src/Type/Doctrine/DoctrineTypeUtils.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Type/Doctrine/DoctrineTypeUtils.php b/src/Type/Doctrine/DoctrineTypeUtils.php index 426fe8ed..43b0496d 100644 --- a/src/Type/Doctrine/DoctrineTypeUtils.php +++ b/src/Type/Doctrine/DoctrineTypeUtils.php @@ -17,7 +17,6 @@ public static function getQueryBuilderTypes(Type $type): array { if ($type instanceof QueryBuilderType) { return [$type]; - // XXX test change - to be reverted } if ($type instanceof UnionType) { From 054bb5efe28eb4112225d510a39d06db9784027f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 18:06:23 +0200 Subject: [PATCH 26/50] Update build.yml --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a049861..d3793e0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -179,7 +179,6 @@ jobs: run: "composer install --no-interaction --no-progress" - name: "Run infection" - if: matrix.php-version == '8.2' || matrix.php-version == '8.3' || matrix.php-version == '8.4' run: | git fetch --depth=1 origin $GITHUB_BASE_REF infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 From 2ae9a03c1ef11acd409b55b37759136852c70328 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 18:08:28 +0200 Subject: [PATCH 27/50] Update QueryBuilderDqlRule.php --- src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php b/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php index abe9961b..fae07a6e 100644 --- a/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php +++ b/src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php @@ -58,7 +58,7 @@ public function processNode(Node $node, Scope $scope): array if (count($queryBuilderTypes) === 0) { if ( $this->reportDynamicQueryBuilders - && (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType)->yes() && true + && (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType)->yes() ) { return [ RuleErrorBuilder::message('Could not analyse QueryBuilder with unknown beginning.') @@ -69,6 +69,15 @@ public function processNode(Node $node, Scope $scope): array return []; } + // testing stuff + $obj = (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType); + if ($obj->yes()) { + $x = 1; + } else { + $x = 2; + } + + try { $dqlType = $scope->getType(new MethodCall($node, new Node\Identifier('getDQL'), [])); } catch (Throwable $e) { From fb3db22d4c68a683a2ca62697946e4cdf10b4354 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 20:45:31 +0200 Subject: [PATCH 28/50] Update infection.json5 --- infection.json5 | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/infection.json5 b/infection.json5 index 1a25adf9..285ba24a 100644 --- a/infection.json5 +++ b/infection.json5 @@ -1,15 +1,16 @@ { - "$schema": "vendor/infection/infection/resources/schema.json", - "source": { - "directories": [ - "src" - ] - }, - "logs": { - "text": "tmp/infection.log" - }, - "mutators": { - "@default": false, - "PHPStan\\Infection\\TrinaryLogicMutator": true - } + "$schema": "vendor/infection/infection/resources/schema.json", + "source": { + "directories": [ + "src" + ] + }, + "staticAnalysisTool": "phpstan", + "logs": { + "text": "tmp/infection.log" + }, + "mutators": { + "@default": false, + "PHPStan\\Infection\\TrinaryLogicMutator": true + } } From c37fc3fe839f846581ff5709d2f29f6dc021afa5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:11:06 +0200 Subject: [PATCH 29/50] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3793e0d..7a2ee3b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,7 +148,7 @@ jobs: mutation-testing: name: "Mutation Testing" runs-on: "ubuntu-latest" - needs: "tests" + needs: ["tests", "static-analysis"] strategy: fail-fast: false From 871cd46e5a75c77b84fc9a710e2ba52c5243f25a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:28:34 +0200 Subject: [PATCH 30/50] Update build.yml --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a2ee3b5..ef32bd43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,6 +178,11 @@ jobs: - name: "Install dependencies" run: "composer install --no-interaction --no-progress" + - uses: "actions/download-artifact@v4" + with: + name: "result-cache" + path: "/tmp/" + - name: "Run infection" run: | git fetch --depth=1 origin $GITHUB_BASE_REF @@ -227,3 +232,8 @@ jobs: - name: "PHPStan" run: "make phpstan" + + - uses: "actions/upload-artifact@v4" + with: + name: "result-cache" + path: "/tmp/resultCache.php" From 7e0fd4a3a4a1bcdd47470dfd87ebcfd3fbf023b0 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:30:13 +0200 Subject: [PATCH 31/50] Update infection.json5 --- infection.json5 | 1 + 1 file changed, 1 insertion(+) diff --git a/infection.json5 b/infection.json5 index 285ba24a..f7536275 100644 --- a/infection.json5 +++ b/infection.json5 @@ -6,6 +6,7 @@ ] }, "staticAnalysisTool": "phpstan", + "staticAnalysisToolOptions": "-l 8 -c phpstan.neon src tests", "logs": { "text": "tmp/infection.log" }, From 946fc28a8629d2146458c7b51d72a0b5dbc8cfcc Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:39:48 +0200 Subject: [PATCH 32/50] Update phpstan.neon --- phpstan.neon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index d3d4ed49..51823048 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -17,6 +17,8 @@ parameters: paths: - src - tests + + resultCachePath: %tmpDir%/resultCache.php excludePaths: - tests/*/data/* From e509b9a93d21aacf84c7693127b3b141b6090897 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:41:47 +0200 Subject: [PATCH 33/50] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef32bd43..7254974e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,7 +181,7 @@ jobs: - uses: "actions/download-artifact@v4" with: name: "result-cache" - path: "/tmp/" + path: "${{ runner.temp }}" - name: "Run infection" run: | @@ -236,4 +236,4 @@ jobs: - uses: "actions/upload-artifact@v4" with: name: "result-cache" - path: "/tmp/resultCache.php" + path: "${{ runner.temp }}/resultCache.php" From 2eecbb92aa993527bdbc53568d56c5a54fbd08d6 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:45:31 +0200 Subject: [PATCH 34/50] use local temp --- .github/workflows/build.yml | 4 ++-- phpstan.neon | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7254974e..f55e3b18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,7 +181,7 @@ jobs: - uses: "actions/download-artifact@v4" with: name: "result-cache" - path: "${{ runner.temp }}" + path: "tmp/" - name: "Run infection" run: | @@ -236,4 +236,4 @@ jobs: - uses: "actions/upload-artifact@v4" with: name: "result-cache" - path: "${{ runner.temp }}/resultCache.php" + path: "tmp/resultCache.php" diff --git a/phpstan.neon b/phpstan.neon index 51823048..385b9690 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -17,8 +17,8 @@ parameters: paths: - src - tests - - resultCachePath: %tmpDir%/resultCache.php + + resultCachePath: tmp/resultCache.php excludePaths: - tests/*/data/* From 704bce24f538b3cd365d405d24b11914c9602a95 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:47:39 +0200 Subject: [PATCH 35/50] unique artifact name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f55e3b18..341ffa31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -180,7 +180,7 @@ jobs: - uses: "actions/download-artifact@v4" with: - name: "result-cache" + name: "result-cache-${{ matrix.php-version }}" path: "tmp/" - name: "Run infection" @@ -235,5 +235,5 @@ jobs: - uses: "actions/upload-artifact@v4" with: - name: "result-cache" + name: "result-cache-${{ matrix.php-version }}" path: "tmp/resultCache.php" From 19706cb2dd8dd6d1ea4e6c7ecda436fa8df57260 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:53:12 +0200 Subject: [PATCH 36/50] Update build.yml --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 341ffa31..ae380154 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,5 +235,6 @@ jobs: - uses: "actions/upload-artifact@v4" with: - name: "result-cache-${{ matrix.php-version }}" + # update-packages is not relevant for the download-artifact part, but we need it here to get unique artifact names across all jobs + name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages }}" path: "tmp/resultCache.php" From 2caea8dad95ef280605a6f7cd1a7eb21eae02f9b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 08:56:32 +0200 Subject: [PATCH 37/50] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae380154..8dfd96bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -236,5 +236,5 @@ jobs: - uses: "actions/upload-artifact@v4" with: # update-packages is not relevant for the download-artifact part, but we need it here to get unique artifact names across all jobs - name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages }}" + name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages && '-updated' || '' }}" path: "tmp/resultCache.php" From 9f9de8f1fbc91904b5c550c718b6d54d65942518 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 09:02:42 +0200 Subject: [PATCH 38/50] fix --- .github/workflows/build.yml | 2 +- infection.json5 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8dfd96bc..bea6ecac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,6 +235,6 @@ jobs: - uses: "actions/upload-artifact@v4" with: - # update-packages is not relevant for the download-artifact part, but we need it here to get unique artifact names across all jobs + # "update-packages" is not relevant for the download-artifact counterpart, but we need it here to get unique artifact names across all jobs name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages && '-updated' || '' }}" path: "tmp/resultCache.php" diff --git a/infection.json5 b/infection.json5 index f7536275..8b990b1a 100644 --- a/infection.json5 +++ b/infection.json5 @@ -6,7 +6,7 @@ ] }, "staticAnalysisTool": "phpstan", - "staticAnalysisToolOptions": "-l 8 -c phpstan.neon src tests", + "staticAnalysisToolOptions": "-l 8 -c phpstan.neon", "logs": { "text": "tmp/infection.log" }, From c4d823ea668e0a23416303204e6599fb5d5b2188 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 09:07:58 +0200 Subject: [PATCH 39/50] Update infection.json5 --- infection.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infection.json5 b/infection.json5 index 8b990b1a..520aa219 100644 --- a/infection.json5 +++ b/infection.json5 @@ -6,7 +6,7 @@ ] }, "staticAnalysisTool": "phpstan", - "staticAnalysisToolOptions": "-l 8 -c phpstan.neon", + "staticAnalysisToolOptions": "--level=8 --configuration=phpstan.neon", "logs": { "text": "tmp/infection.log" }, From 93d3d97bc17fccfee2d2cebb25158406c8f1a061 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 09:10:18 +0200 Subject: [PATCH 40/50] Update infection.json5 --- infection.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infection.json5 b/infection.json5 index 520aa219..af5e7759 100644 --- a/infection.json5 +++ b/infection.json5 @@ -6,7 +6,7 @@ ] }, "staticAnalysisTool": "phpstan", - "staticAnalysisToolOptions": "--level=8 --configuration=phpstan.neon", + "staticAnalysisToolOptions": "--level=8", "logs": { "text": "tmp/infection.log" }, From 01a919736b85d42d036cf1467c31fffe12f397ba Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 09:15:54 +0200 Subject: [PATCH 41/50] Update infection.json5 --- infection.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infection.json5 b/infection.json5 index af5e7759..0ee0fad9 100644 --- a/infection.json5 +++ b/infection.json5 @@ -6,7 +6,7 @@ ] }, "staticAnalysisTool": "phpstan", - "staticAnalysisToolOptions": "--level=8", + "staticAnalysisToolOptions": "--level=8 src tests", "logs": { "text": "tmp/infection.log" }, From 58e765a8b7805e851acd7e8658fedfbf0e9ddb5e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 09:38:28 +0200 Subject: [PATCH 42/50] simplify --- infection.json5 | 1 - tests/Infection/TrinaryLogicMutator.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/infection.json5 b/infection.json5 index 0ee0fad9..285ba24a 100644 --- a/infection.json5 +++ b/infection.json5 @@ -6,7 +6,6 @@ ] }, "staticAnalysisTool": "phpstan", - "staticAnalysisToolOptions": "--level=8 src tests", "logs": { "text": "tmp/infection.log" }, diff --git a/tests/Infection/TrinaryLogicMutator.php b/tests/Infection/TrinaryLogicMutator.php index a68f35a2..67e9b530 100644 --- a/tests/Infection/TrinaryLogicMutator.php +++ b/tests/Infection/TrinaryLogicMutator.php @@ -19,7 +19,7 @@ public static function getDefinition(): Definition { return new Definition( <<<'TXT' - Replaces TrinaryLogic->yes() with !TrinaryLogic->no() + Replaces TrinaryLogic->yes() with !TrinaryLogic->no() and vice versa. TXT , MutatorCategory::ORTHOGONAL_REPLACEMENT, From 378e5185a7b70569654b6ba9c26322e8924e6d10 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 11:36:58 +0200 Subject: [PATCH 43/50] increase timeout --- infection.json5 | 1 + 1 file changed, 1 insertion(+) diff --git a/infection.json5 b/infection.json5 index 285ba24a..0c2927d4 100644 --- a/infection.json5 +++ b/infection.json5 @@ -1,5 +1,6 @@ { "$schema": "vendor/infection/infection/resources/schema.json", + "timeout": 25, "source": { "directories": [ "src" From b3b8b99d7c73a55bf69efc9dc11ddbc59087309a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 11:37:03 +0200 Subject: [PATCH 44/50] Update infection.json5 --- infection.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infection.json5 b/infection.json5 index 0c2927d4..7afd7230 100644 --- a/infection.json5 +++ b/infection.json5 @@ -1,6 +1,6 @@ { "$schema": "vendor/infection/infection/resources/schema.json", - "timeout": 25, + "timeout": 30, "source": { "directories": [ "src" From 67cf382d40df371c2bd1527d97da33bbd8b0012d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 11:45:32 +0200 Subject: [PATCH 45/50] upload infection log as artifact to ease debugging --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bea6ecac..e90225ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -188,6 +188,11 @@ jobs: git fetch --depth=1 origin $GITHUB_BASE_REF infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 + - uses: "actions/upload-artifact@v4" + with: + name: "infection-log-${{ matrix.php-version }}" + path: "tmp/infection.log" + static-analysis: name: "PHPStan" runs-on: "ubuntu-latest" From c0e5252dc31a7708ef6b05e9adb20fd19fffc07f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 11:45:51 +0200 Subject: [PATCH 46/50] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e90225ff..bf13d2b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -241,5 +241,5 @@ jobs: - uses: "actions/upload-artifact@v4" with: # "update-packages" is not relevant for the download-artifact counterpart, but we need it here to get unique artifact names across all jobs - name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages && '-updated' || '' }}" + name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages && '-packages-updated' || '' }}" path: "tmp/resultCache.php" From d954a451f64fe8c14fee6f77246ada76e89ac36b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 11:52:52 +0200 Subject: [PATCH 47/50] enable debugging --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf13d2b5..7d0c8856 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -186,7 +186,7 @@ jobs: - name: "Run infection" run: | git fetch --depth=1 origin $GITHUB_BASE_REF - infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 + infection --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-lines --ignore-msi-with-no-mutations --min-msi=100 --min-covered-msi=100 --log-verbosity=all --debug - uses: "actions/upload-artifact@v4" with: From 13ad6418f7a46f3fd1979fbd0feccd38913eb526 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 12:02:51 +0200 Subject: [PATCH 48/50] pin infection version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d0c8856..9af16aee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,7 @@ jobs: php-version: "${{ matrix.php-version }}" ini-file: development extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - tools: infection + tools: infection:0.31.2 - name: "Allow installing on PHP 8.4" if: matrix.php-version == '8.4' From 3bddff7ab607e9dd354681b9e899470967d5028c Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 12:24:24 +0200 Subject: [PATCH 49/50] update to infection:0.31.3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9af16aee..fb8b2b62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,7 @@ jobs: php-version: "${{ matrix.php-version }}" ini-file: development extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - tools: infection:0.31.2 + tools: infection:0.31.3 - name: "Allow installing on PHP 8.4" if: matrix.php-version == '8.4' From 91d8b14596c24febd28bb4e10493f16f0369771b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 7 Oct 2025 14:35:05 +0200 Subject: [PATCH 50/50] pin infection:0.31.4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb8b2b62..6eb49c69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,7 @@ jobs: php-version: "${{ matrix.php-version }}" ini-file: development extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb - tools: infection:0.31.3 + tools: infection:0.31.4 - name: "Allow installing on PHP 8.4" if: matrix.php-version == '8.4'