Conversation
… native deprecation gate
ViniTou
force-pushed
the
phpunit-11-deprecation-gate
branch
from
September 17, 2026 16:34
0e219ad to
b064608
Compare
…HPUnit 9 convert*ToExceptions strictness
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.
Description:
SYMFONY_DEPRECATIONS_HELPERthresholds are dead under PHPUnit ≥10 (phpunit-bridge's bootstrap returns early and registers no deprecation handler), so@-silencedtrigger_deprecation()calls went unchecked. This repo had already migrated to PHPUnit 11 with noSYMFONY_DEPRECATIONS_HELPERenv line left to remove, so this PR only adds the native gate:failOnDeprecation="true"+displayDetailsOnTestsThatTriggerDeprecations="true"onphpunit.xml.dist, plus a<source ignoreIndirectDeprecations="false" ignoreSuppressionOfDeprecations="true" baseline="phpunit.baseline.xml">includingrules/(this repo's real production source dir percomposer.jsonpsr-4, notsrc/).Only one config exists (
phpunit.xml.dist, suiterules) and it gates cleanly: baseline is empty (0 issues, 0 internal / 0 external) — the 4-test suite currently triggers no deprecations. No suites were left ungated.Caveat found while probing: PHPStan's own
FileAnalyser::collectErrors()installs a private error handler around each file analysis (vendor/phpstan/phpstan/phpstan.phar,Analyser/FileAnalyser.php), and it does not forward suppressed/deprecated errors to any previously-registered handler. Since this repo's rule classes only run inside that analysis loop (viaprocessNode(), invoked byPHPStan\Testing\RuleTestCase), a deprecation triggered from inside a rule'sprocessNode()body is silently swallowed and will not fail the build — this is PHPStan's own testing-harness behavior, not something we patched or worked around (vendor code, out of scope). A deprecation triggered anywhere else that PHPUnit exercises directly (rule constructors, test/fixture code, library calls outside the analysis loop) is caught correctly, confirmed via probe (see PR conversation / task report for detail).To refresh the baseline: ensure
vendor/is a real (non-symlinked) directory with PHPUnit 11 installed, then runvendor/bin/phpunit -c phpunit.xml.dist --generate-baseline phpunit.baseline.xml.Merge note: this repo's PHPUnit 11 migration is already merged to
6.0, so this branch is built directly offorigin/6.0and is not stacked on any other open PR.Additionally, in this pass:
failOnNotice="true"onphpunit.xml.dist(alongside the already-presentfailOnWarning="true"), matching the PHPUnit 9convertNoticesToExceptions/convertWarningsToExceptionsstrictness that PHPUnit 10 removed as flags — without it, notices and warnings would no longer fail the build.symfony/phpunit-bridgedependency exists in this repo (composer.json, noSymfony\Bridge\PhpUnitusage, noClockMock/DnsMock/ExpectDeprecationTrait), so there is nothing to drop and noexpectDeprecation()calls to convert.For QA:
N/A
Documentation:
N/A