Skip to content

build(deps): Allow webmozart/assert ^2.0 - #355

Open
cancan101 wants to merge 1 commit into
webmozarts:mainfrom
cancan101:claude/console-parallelization-354-z0dyuh
Open

build(deps): Allow webmozart/assert ^2.0#355
cancan101 wants to merge 1 commit into
webmozarts:mainfrom
cancan101:claude/console-parallelization-354-z0dyuh

Conversation

@cancan101

Copy link
Copy Markdown

Fixes #354.

Widens the webmozart/assert constraint from ^1.11 to ^1.11 || ^2.0 so
downstream projects are not blocked from upgrading to 2.x.

Compatibility

All 16 assertion methods used in src/ (plus Assert::isInstanceOf in the
tests) exist in webmozart/assert 2.0.0 and up. Worth noting: 2.x dropped
__callStatic, so the nullOr* prefixes rely entirely on the generated
Mixin trait — I checked, and nullOrNatural is present in Mixin in both
2.0.0 and 2.4.1, same as in 1.x. The other relevant 2.x change is additive:
assertions now return the validated value instead of void.

Verification

Ran the suite against webmozart/assert 2.4.1 on PHP 8.4: 325/325 pass, 480
assertions. Downgraded to 1.12.1 and re-ran: identical results, including the
same single risky test
(ParallelizationIntegrationTest::test_it_can_run_the_command_a_command_with_the_legacy_api_in_the_main_process),
which is pre-existing and unrelated.

Caveat

CI will keep resolving to 1.x: infection/infection ^0.29.14 || ^0.31.0
still requires webmozart/assert ^1.11, so the new upper range is not
actually exercised. Infection 0.33+ already allows ^1.11 || ^2.0, so
bumping it would close the gap — left out here as a separate change.

For the record, phpstan/phpstan-webmozart-assert is not a blocker; it
declares no webmozart/assert requirement at all.

The `^1.11` upper bound blocks downstream projects from upgrading to
webmozart/assert 2.x, which they may need for transitive reasons (see webmozarts#354).

All 16 assertion methods used in `src/` (plus `Assert::isInstanceOf` in the
tests) exist in webmozart/assert 2.0.0 and up — `nullOrNatural` is provided by
the generated `Mixin` trait in 2.x, just like in 1.x. The 2.x changes that
could matter here are additive: the assertions now return the validated value
instead of `void`.

Verified locally against webmozart/assert 2.4.1 on PHP 8.4: the full test
suite passes (325/325), with the same single pre-existing risky test as on
1.12.1.

Note that CI keeps resolving to 1.x for now, since `infection/infection`
`^0.29.14 || ^0.31.0` still requires `webmozart/assert ^1.11`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGu7MLWUf3ADxENneuGqLX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widen the webmozart/assert constraint to ^1.11 || ^2.0

2 participants