Skip to content

IBX-12606: Replaced the Symfony deprecation thresholds with PHPUnit's native deprecation gate - #354

Merged
konradoboza merged 1 commit into
6.0from
phpunit-11-deprecation-gate
Sep 23, 2026
Merged

konradoboza merged 1 commit into
6.0from
phpunit-11-deprecation-gate

Conversation

@ViniTou

@ViniTou ViniTou commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12606

Description:

SYMFONY_DEPRECATIONS_HELPER thresholds are dead under PHPUnit >=10: phpunit-bridge no longer registers a DeprecationErrorHandler, so trigger_deprecation() calls were silently ignored. This replaces it with PHPUnit 11's native gate: failOnDeprecation + a per-config <source baseline="..."> scoped to src/lib, src/contracts and src/bundle, so CI fails only on NEW deprecations.

phpunit.xml and phpunit-integration.xml are gated. phpunit.xml's baseline carries 2 issues (both League\Flysystem\Local\LocalFilesystemAdapter::__construct() implicit-nullable-parameter deprecations, PHP 8.4-only); phpunit-integration.xml's baseline is empty: 0 issues — no pre-existing src-level deprecations. phpunit-integration-legacy.xml and phpunit-integration-legacy-solr.xml are left ungated: neither had a SYMFONY_DEPRECATIONS_HELPER line to remove. The legacy suite now passes locally (exit 0; the non-static data-provider issue was fixed by #352). The solr suite still needs a running Solr instance on localhost:8983 that isn't available locally, so it remains unverified here. Gating those two is left for CI/a follow-up.

Verified with a trigger_deprecation() probe in src/lib/FieldType/RichText/Value.php (constructor, exercised by hundreds of unit tests): the unit suite correctly failed, then passed again after removal (git diff -- src clean). composer check-cs and phpstan analyse are unchanged (clean).

To refresh a baseline: ensure vendor/ is a real (non-symlinked) directory with PHPUnit 11 installed, then run vendor/bin/phpunit -c <config> --generate-baseline <baseline>.

Base branch: 6.0 (the PHPUnit 11 migration landed as ec4f4e3 — squash-merge of #352 — and this branch is now rebased directly onto it).

  • ignoreIndirectDeprecations is deliberately false: PHPUnit classifies a Symfony deprecation caused by our code as "indirect" (callee deprecation-contracts/function.php, caller the vendor method), so true would silently drop every deprecated-vendor-API usage. Vendor-originated baseline entries are expected; new ones fail the build until the baseline is refreshed on purpose.
  • Baselines were generated on the repo's highest CI PHP version at the time of authoring; regenerate with whatever is currently the highest version in the matrix (currently 8.3 — this repo's CI matrix has since dropped 8.4).

Re-verified after the rebase onto 6.0: failOnWarning="true" failOnNotice="true" are already present on every phpunit*.xml config (added by #352), symfony/phpunit-bridge is already fully gone from composer.json with zero remaining usages anywhere in the repo, and no ExpectDeprecationTrait/expectDeprecation() calls exist to convert. No additional commits were needed on top of the deprecation-gate commit. Both gated suites (phpunit.xml, phpunit-integration.xml) still pass with the existing baselines on PHP 8.3 (exit 0); phpunit-integration-legacy-solr.xml is unrunnable locally (needs a live Solr instance on localhost:8983) but is unaffected by this change since it isn't gated.

For QA:

N/A

Documentation:

N/A

@ViniTou
ViniTou force-pushed the phpunit-11-deprecation-gate branch 4 times, most recently from 55ad2e7 to adb6d5d Compare September 18, 2026 10:50
Base automatically changed from phpunit-11 to 6.0 September 18, 2026 11:32
@ViniTou
ViniTou force-pushed the phpunit-11-deprecation-gate branch from adb6d5d to d3799bc Compare September 18, 2026 14:09
@sonarqubecloud

Copy link
Copy Markdown

@konradoboza
konradoboza merged commit 14d9acc into 6.0 Sep 23, 2026
18 checks passed
@konradoboza
konradoboza deleted the phpunit-11-deprecation-gate branch September 23, 2026 09:27
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.

4 participants