Skip to content

refactor!: mark the fragment system @internal and deprecated - #6779

Merged
gharlan merged 3 commits into
6.xfrom
deprecate-fragment
Oct 21, 2026
Merged

gharlan merged 3 commits into
6.xfrom
deprecate-fragment

Conversation

@gharlan

@gharlan gharlan commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

The fragment system is going to be removed before the 6.0 release.

  • Fragment is marked @internal, so it's clear for anyone already building on 6.x that it must not be used anymore, and we can drop it at any time instead of having to keep it until 7.0.
  • It is additionally marked @deprecated as an extra warning, and so that the remaining usages are tracked in the PHPStan baseline.

Baseline: only the new Fragment calls are added to the baseline (new.deprecatedClass.php), deliberately — it's the to-do list for removing the fragments and should shrink with every port. The other deprecation errors for Fragment (method/property access, @var Fragment $this in the templates, addDirectory(), the rex_fragment rename in rector.php) are ignored via ignoreErrors in phpstan.dist.neon, since they would only duplicate the list. Once the class is gone, PHPStan reports the ignore rule as unmatched. In Psalm, DeprecatedClass is suppressed for Fragment only.

The fragment system is going to be removed before the 6.0 release. `@internal` makes clear that new code for 6.x
must not rely on it, so it can be dropped at any time; `@deprecated` additionally warns users and lets the PHPStan
baseline track the remaining usages.
@gharlan gharlan added this to the REDAXO 6.0 milestone Oct 21, 2026
@gharlan
gharlan merged commit 8630a4f into 6.x Oct 21, 2026
15 checks passed
@gharlan
gharlan deleted the deprecate-fragment branch October 21, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants