This PR was merged into the 3.x branch.
Discussion
----------
Deprecate not passing a `BodyNode` instance as the body of a `ModuleNode` or `MacroNode` constructor
Commits
-------
51e93aa1 Deprecate not passing a BodyNode instance as the body of a ModuleNode constructor
This PR was merged into the 3.x branch.
Discussion
----------
Update a phpdoc (ModuleNode is final now)
Commits
-------
313303b3 Update a phpdoc (ModuleNode is final now)
This PR was merged into the 3.x branch.
Discussion
----------
Add support for integers in methods of `Twig\Node\Node` that take a Node name
Closes#3811
Commits
-------
1ee4210b Deprecate node names that are not strings or integers
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate OptimizerNodeVisitor::OPTIMIZE_TEXT_NODES
Refs #4146
While trying to debug #4146, I realized that this optimization is not possible as we don't know how nodes are going to be used.
See the script provided in #4146 to reproduce the problem.
`@brandonkelly` Can you confirm that this fixes your problem? Maybe there is also an issue with yield vs echo, but the script provided in the issue runs fine for me after this PR.
Commits
-------
7121673c Deprecate OptimizerNodeVisitor::OPTIMIZE_TEXT_NODES
This PR was squashed before being merged into the 4.x branch.
Discussion
----------
Add private types on 4.x
(WIP but i open to gather early feedback / comments)
Objective: add missing types
- [x] Private properties
- [x] Return type on private methods
- [ ] Argument types on private methods (?not sure)
Maybe "`@internal`" then
Commits
-------
72bbe489 Add private types on 4.x
This PR was squashed before being merged into the 4.x branch.
Discussion
----------
Do not hide unnecessary escape characters
Follow up of #4176, #4123 and #2712.
Now that we have deprecated unnecessary escape in v3, we can change the behavior in v4.
With this change, unnecessary will no longer be ignored, but handled like any other character.
This allows for writing fully qualified class names like this:
```twig
{{ constant('App\Entity\User::SOME_CONSTANT') }}
```
Instead of having to escape the `\` in v3:
```twig
{{ constant('App\\Entity\\User::SOME_CONSTANT') }}
```
/cc `@fabpot` `@stof`
Commits
-------
53c24bfc Do not hide unnecessary escape characters
This PR was merged into the 3.x branch.
Discussion
----------
ChainLoader constructor should accept iterable instead of array
Closes#4200
Commits
-------
6ef13d1eResolves#4200
This PR was merged into the 3.x branch.
Discussion
----------
Swap BC layer for yield-ready and reclaim perf loss
Follows #3999Fix#4146Fix#4103
When `use_yield` is set to false (the default), this PR reverts the implementation of the `render()` method to use a wrapping output buffer instead of hooking between each steps of generators. In this mode, the behavior of the yield method is not "pure": it triggers a mix of yield and echo. But this is fine for render and display methods.
When `use_yield` is set to `true`, we skip that wrapping output buffer. This makes twig compatible with fibers (and this also makes compilation fail if a non-YieldReady extension is found.)
That makes the name of the option not ideal, but BC rulez FTW.
Commits
-------
5d1a19a8 Swap BC layer for yield-ready and reclaim perf loss
This PR was merged into the 3.x branch.
Discussion
----------
Accept colons instead of equals for named arguments
Refs #3475
Refs #3635
Commits
-------
84116e5f Fix typos in CHANGELOG