-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Support for Twig 3 #33039
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
Conversation
4bd824f
to
0ea6aab
Compare
0ea6aab
to
af7d80b
Compare
See #33269 |
…(fabpot) This PR was merged into the 4.4 branch. Discussion ---------- [TwigBridge] Mark all classes extending twig as @Final | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes-ish | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | refs #33039 | License | MIT | Doc PR | n/a Classes defining extensions/nodes/node visitors/token parsers should not be changed. They should be final. That would also help with Twig 3.0 which introduces type hints (including return types). Commits ------- d657459 [TwigBridge] Mark all classes extending twig as @Final
af7d80b
to
6545600
Compare
6545600
to
6e108b1
Compare
6e108b1
to
9447ccf
Compare
Ready. Also, I'm wondering if we should backport the composer.json changes (except for the bridge, of course) to 4.4. An Symfony 4.4 application with TwigBridge 5.0 should technically be able to run Twig 3. |
Symfony 4.4 still supports 1.x, so it cannot support 1.x/2.x and 3.0 at the same time. |
81b4cf1
to
b3b7570
Compare
This PR was merged into the 4.4 branch. Discussion ---------- Removed calls to Twig\Environment::loadTemplate() | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A This PR prepares #33039. Twig 3 does not have the `loadTemplate()` anymore, so this PR replaces calls to that method. Commits ------- ea9e375 Removed calls to Twig\Environment::loadTemplate().
b3b7570
to
57f1451
Compare
I've just merged 4.4 into master so that this one can be rebased. |
57f1451
to
b050ccc
Compare
We should also replace all |
Rebased. |
b050ccc
to
f30edca
Compare
Done. |
Should I also remove the |
Also, I will add return type declarations to all |
|
Ready. |
Thank you @derrabus. |
This PR was squashed before being merged into the 5.0-dev branch (closes #33039). Discussion ---------- [TwigBridge] Support for Twig 3 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A I occasionally test my projects against dev branches of the libraries I use. It's probably a bit early for this PR, but since I had to patch Symfony anyway in order to test Twig 3 in my projects, I though I might as well share the branch with you. BC break: I had to add return types to several non-final classes of the Twig bridge. This will break applications that override these classes without adding the return types. This PR is marked as a draft because Twig 3 is still a moving target. Commits ------- 44ed90c Finalized all `@final` classes. f30edca Support for Twig 3.
I occasionally test my projects against dev branches of the libraries I use. It's probably a bit early for this PR, but since I had to patch Symfony anyway in order to test Twig 3 in my projects, I though I might as well share the branch with you.
BC break: I had to add return types to several non-final classes of the Twig bridge. This will break applications that override these classes without adding the return types.
This PR is marked as a draft because Twig 3 is still a moving target.