Repository navigation
refactor!: mark the fragment system @internal and deprecated - #6779
Merged
Merged
Conversation
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.
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.
The fragment system is going to be removed before the 6.0 release.
Fragmentis 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.@deprecatedas an extra warning, and so that the remaining usages are tracked in the PHPStan baseline.Baseline: only the
new Fragmentcalls 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 forFragment(method/property access,@var Fragment $thisin the templates,addDirectory(), therex_fragmentrename inrector.php) are ignored viaignoreErrorsinphpstan.dist.neon, since they would only duplicate the list. Once the class is gone, PHPStan reports the ignore rule as unmatched. In Psalm,DeprecatedClassis suppressed forFragmentonly.