-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Late deprecation for TwigRendererEngine::setEnvironment() #21021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TwigBridge] Late deprecation for TwigRendererEngine::setEnvironment() #21021
Conversation
Not sure about this one. AFAIU, the user will now receive two deprecation notices as if they don't pass Twig env as a constructor argument, they probably call the setter. |
well, if they pass it in the constructor and still call the setter later, removing the setter would break their app without warning. So we need a deprecation warning there (to avoid the double deprecation warning, we may trigger it only when we already have an environment) |
28d55d1
to
5ef1565
Compare
Indeed, updated to avoid the double warning. Should this target 3.2? If so I'll update the corresponding UPGRADE file |
3.3 is fine. |
@@ -217,6 +217,9 @@ TwigBridge | |||
* The possibility to inject the Form Twig Renderer into the form extension | |||
has been removed. Inject it into the `TwigRendererEngine` instead. | |||
|
|||
* The `TwigRendererEngine::setEnvironment()` method has been removed. | |||
Pass the Twig Environment as second argument of the constructor instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be documented in the UPGRADE-3.3.md
file.
5ef1565
to
aabb73c
Compare
UPGRADE files updated |
👍 |
Thank you @chalasr. |
…tEnvironment() (chalasr) This PR was merged into the 3.3-dev branch. Discussion ---------- [TwigBridge] Late deprecation for TwigRendererEngine::setEnvironment() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #20093 (comment) | License | MIT | Doc PR | n/a This method should have been deprecated in 3.2 since the twig environment should be injected through the constructor and replacing it later can break things (see #20093 (comment) for details). Maybe this could target 3.2 Commits ------- aabb73c Deprecate TwigRendererEngine::setEnvironment()
This method should have been deprecated in 3.2 since the twig environment should be injected through the constructor and replacing it later can break things (see #20093 (comment) for details).
Maybe this could target 3.2