You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #54496 [Contracts] Rename ServiceSubscriberTrait to ServiceMethodsSubscriberTrait (nicolas-grekas)
This PR was merged into the 7.1 branch.
Discussion
----------
[Contracts] Rename ServiceSubscriberTrait to ServiceMethodsSubscriberTrait
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Issues | Fix #54490
| License | MIT
As described in the linked PR, AbstractController is incompatible with ServiceSubscriberTrait because of the added type to the AbstractController::$container property, while ServiceSubscriberTrait's $container property cannot have a type without a BC break.
There are two parts to this PR:
- Deprecate ServiceSubscriberTrait in favor if ServiceMethodsSubscriberTrait, which declares the type of the $container property. The new name better conveys its purpose as a bonus.
- Fix the incompatibility with AbstractController by removing the property declaration on ServiceSubscriberTrait. This means the
trait will create a dynamic property. Those are deprecated, but since the trait is also deprecated, the upgrade path is clear.
I also tried to improve the description of the trait in the meantime.
/cc `@kbond`
Commits
-------
8f47ced9dd [Contracts] Rename ServiceSubscriberTrait to ServiceMethodsSubscriberTrait
0 commit comments