Repository navigation
ci: green 4.9.x again with PHPStan 2.3.2 and Rector 2.7.0 - #230
Merged
Merged
Conversation
The phpqa:8.4 image now ships PHPStan 2.3.2 and Rector 2.7.0, which fail on code already on 4.9.x: - PHPStan does not see the `$i++` in the `for` initializer of Rfc9162Sha256::treeHash() as changing `$i` across the outer foreach, so it reads `$merges` as always 0 and flags `($merges & 1) === 1`. The increment now sits after the inner loop; the merge count is unchanged. - Rector applies AssertTrueFalseToSpecificMethodRector (assertTrue(is_array()) -> assertIsArray()) in six test files and TernaryToNullsafeCoalesceRector in Ecdh::agree(); KeyWrap::keyLength() returns int, so `?->` + `??` is equivalent to the ternary.
1 of 4 tasks
Spomky
added a commit
that referenced
this pull request
Nov 23, 2026
* test: assert the types of PackagingTest with assertIsArray and assertIsString Rector 2.8.5, in the phpqa:8.4 image rebuilt on 2026-11-22, applies AssertTrueFalseToSpecificMethodRector to tests/PackagingTest.php: assertTrue(is_array()) becomes assertIsArray() and assertTrue(is_string()) becomes assertIsString(), so `castor rector` exits 2 on 4.8.x. The change is the one 4.9.x made to the same file in 8af085b (#230), byte for byte, so the merge-up into 4.9.x takes it without a conflict. The assertions check the same thing. Assisted-by: Claude Opus 5.5 * test: a data provider yields what the test method accepts The mutation testing job has failed on every push to 4.8.x since 10 September, and the failure is not in src/: Infection runs the newest PHPUnit of the phpqa image (13.3.1 then, 13.4.8 now), while the test jobs run phpunit-11. PHPUnit 13 warns when a data set carries more arguments than the test method takes: 6 tests, 49 warnings, in four classes. The suite is configured with failOnWarning, so the initial run Infection needs exits 1 and it stops with "Project tests must be in a passing state before running Infection". This is the change 4.9.x made in e984d6b (#236), restricted to the four classes 4.8.x has: KeyRestrictionEnforcementTest, PrehashedEdDSATest, OversizedRsaKeyTest and DeprecatedTagClassesTest. Each rich provider stays the single source of truth; the methods that read only its first values take a narrow provider derived from it. No test, no data set and no assertion changes: 124 tests and 296 assertions in these classes before and after under phpunit-11, and the same under PHPUnit 13.4.8, where the warnings are gone. Assisted-by: Claude Opus 5.5 * docs: align the support matrix with the one of the default branch RELEASES.md on 4.8.x still listed 4.8.x as in development, 4.7.x as supported and 4.6.x and 4.5.x as receiving security fixes, while the matrix of the default branch, which SECURITY.md names as the single source of truth, lists 4.9.x in development, 4.8.x supported and nothing below 4.8.x (#238). The table is now the one of 4.9.x, line for line, so both branches say the same thing and the merge-up into 4.9.x takes it without a conflict. Assisted-by: Claude Opus 5.5
Merged
Spomky
added a commit
that referenced
this pull request
Nov 23, 2026
* test: assert the types of PackagingTest with assertIsArray and assertIsString Rector 2.8.5, in the phpqa:8.4 image rebuilt on 2026-11-22, applies AssertTrueFalseToSpecificMethodRector to tests/PackagingTest.php: assertTrue(is_array()) becomes assertIsArray() and assertTrue(is_string()) becomes assertIsString(), so `castor rector` exits 2 on 4.8.x. The change is the one 4.9.x made to the same file in 8af085b (#230), byte for byte, so the merge-up into 4.9.x takes it without a conflict. The assertions check the same thing. Assisted-by: Claude Opus 5.5 * test: a data provider yields what the test method accepts The mutation testing job has failed on every push to 4.8.x since 10 September, and the failure is not in src/: Infection runs the newest PHPUnit of the phpqa image (13.3.1 then, 13.4.8 now), while the test jobs run phpunit-11. PHPUnit 13 warns when a data set carries more arguments than the test method takes: 6 tests, 49 warnings, in four classes. The suite is configured with failOnWarning, so the initial run Infection needs exits 1 and it stops with "Project tests must be in a passing state before running Infection". This is the change 4.9.x made in e984d6b (#236), restricted to the four classes 4.8.x has: KeyRestrictionEnforcementTest, PrehashedEdDSATest, OversizedRsaKeyTest and DeprecatedTagClassesTest. Each rich provider stays the single source of truth; the methods that read only its first values take a narrow provider derived from it. No test, no data set and no assertion changes: 124 tests and 296 assertions in these classes before and after under phpunit-11, and the same under PHPUnit 13.4.8, where the warnings are gone. Assisted-by: Claude Opus 5.5 * docs: align the support matrix with the one of the default branch RELEASES.md on 4.8.x still listed 4.8.x as in development, 4.7.x as supported and 4.6.x and 4.5.x as receiving security fixes, while the matrix of the default branch, which SECURITY.md names as the single source of truth, lists 4.9.x in development, 4.8.x supported and nothing below 4.8.x (#238). The table is now the one of 4.9.x, line for line, so both branches say the same thing and the merge-up into 4.9.x takes it without a conflict. Assisted-by: Claude Opus 5.5
Merged
Spomky
added a commit
that referenced
this pull request
Nov 23, 2026
* ci: green 4.8.x again with today's phpqa images (#240) * test: assert the types of PackagingTest with assertIsArray and assertIsString Rector 2.8.5, in the phpqa:8.4 image rebuilt on 2026-11-22, applies AssertTrueFalseToSpecificMethodRector to tests/PackagingTest.php: assertTrue(is_array()) becomes assertIsArray() and assertTrue(is_string()) becomes assertIsString(), so `castor rector` exits 2 on 4.8.x. The change is the one 4.9.x made to the same file in 8af085b (#230), byte for byte, so the merge-up into 4.9.x takes it without a conflict. The assertions check the same thing. Assisted-by: Claude Opus 5.5 * test: a data provider yields what the test method accepts The mutation testing job has failed on every push to 4.8.x since 10 September, and the failure is not in src/: Infection runs the newest PHPUnit of the phpqa image (13.3.1 then, 13.4.8 now), while the test jobs run phpunit-11. PHPUnit 13 warns when a data set carries more arguments than the test method takes: 6 tests, 49 warnings, in four classes. The suite is configured with failOnWarning, so the initial run Infection needs exits 1 and it stops with "Project tests must be in a passing state before running Infection". This is the change 4.9.x made in e984d6b (#236), restricted to the four classes 4.8.x has: KeyRestrictionEnforcementTest, PrehashedEdDSATest, OversizedRsaKeyTest and DeprecatedTagClassesTest. Each rich provider stays the single source of truth; the methods that read only its first values take a narrow provider derived from it. No test, no data set and no assertion changes: 124 tests and 296 assertions in these classes before and after under phpunit-11, and the same under PHPUnit 13.4.8, where the warnings are gone. Assisted-by: Claude Opus 5.5 * docs: align the support matrix with the one of the default branch RELEASES.md on 4.8.x still listed 4.8.x as in development, 4.7.x as supported and 4.6.x and 4.5.x as receiving security fixes, while the matrix of the default branch, which SECURITY.md names as the single source of truth, lists 4.9.x in development, 4.8.x supported and nothing below 4.8.x (#238). The table is now the one of 4.9.x, line for line, so both branches say the same thing and the merge-up into 4.9.x takes it without a conflict. Assisted-by: Claude Opus 5.5 * ci: let the mutation run outlive Composer's process timeout (#242) `castor infect` runs `composer exec -- infection`, and `composer exec` kills its child process after `process-timeout`, 300 seconds by default. The Mutation Testing job of 4.9.x died at exactly that limit (run 45197554242). The one of 4.8.x still finishes, but its Infection step took 232 seconds on the last push (run 45226114186), so a few more tests or a slower runner would kill it the same way. `COMPOSER_PROCESS_TIMEOUT=0` lifts that ceiling, and the job now carries `timeout-minutes: 45` so that a run which really is stuck cannot burn the six hours GitHub grants by default. The variable is set by the castor task rather than by the workflow, because `phpqa()` dropped its environment on exactly the path the CI takes: it passed it as `docker run -e` options, and it skips Docker whenever it already runs inside a container. The helper now takes a name => value map and applies it to both paths. This is 095a7fe (#241) of 4.9.x, byte for byte, so the merge-up into 4.9.x takes it without a conflict. Assisted-by: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The open PRs (#227, #229) fail on
1️⃣ Static Analysis (PHPStan)and3️⃣ Refactoring (Rector). They are not the cause:ghcr.io/spomky-labs/phpqa:8.4now ships PHPStan 2.3.2 and Rector 2.7.0, and both flag code that is already on 4.9.x. The test jobs show as skipped on those PRs only because they depend on the static jobs.PHPStan:
src/Structure/VerifiableDataStructure/Rfc9162Sha256.php:131PHPStan does not see the
$i++in theforinitializer as changing$iacross the outerforeach, so it reads$mergesas always0. The increment now sits after the inner loop. The merge count per leaf is the same, and the RFC 9162 fixtures (transparency-dev vectors) still pass.Rector: 7 files
AssertTrueFalseToSpecificMethodRector:assertTrue(is_array(...))/assertTrue(is_string(...))becomeassertIsArray()/assertIsString()in six test files.TernaryToNullsafeCoalesceRectorinEcdh::agree():$wrap === null ? $layer->keyLength() : $wrap->keyLength()becomes$wrap?->keyLength() ?? $layer->keyLength().KeyWrap::keyLength()returnsint, so the two forms behave the same.Verification
Run locally in
ghcr.io/spomky-labs/phpqa:8.4aftercomposer update(highest, as in CI):castor phpstan,castor rector,castor ecs,castor deptrac,castor lint: all exit 0composer test: 3564 tests OK, 84 skipped (the known cose-wg divergences)Once this is merged, #227 and #229 can be rebased onto 4.9.x.
Note:
tests/PackagingTest.phpon 4.8.x has the sameassertTrue(is_array())pattern, so Rector is probably red there too. Not changed here.