This PR was merged into the 3.x branch.
Discussion
----------
Fix some errors reported by phpstan
Commits
-------
2b2ac80d Fxi some errors reported by phpstan
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Deprecate usage of ob_* functions in favor of yielding
Still a work in progress, but everything works fine in both modes.
Commits
-------
a93723ea Fix bug
0d3a2839 Tweak code
14d38036 Add a deprecation when a Node uses echo/print
210e2d2b Fix tests
1591aa5c Optimize code
1469e6a6 Add support for templates that do not have output Nodes
72922a36 -
71e90fab Remove some tests
4fd62abb -
a9c7307b Tweak code
15879406 Remove the new yield nodes
3b6cbf98 Remove usage of ob_* functions in favor of yielding
This PR was merged into the 3.x branch.
Discussion
----------
Remove support for Twig 2.x and unmaintained Symfony versions
Commits
-------
b1a8feaa Remove support for Twig 2.x and unmaintained Symfony versions
This PR was merged into the 3.x branch.
Discussion
----------
Clarify the behavior when a property/method does not exist
Alternative to #3964
Commits
-------
1ed424d5 Clarify the behavior when a property/method does not exist
This PR was merged into the 3.x branch.
Discussion
----------
Throws proper Twig exception when using cycle on an empty array
Closes#3925
Commits
-------
d21666f7 Throws proper Twig exception when using cycle on an empty array
This PR was merged into the 3.x branch.
Discussion
----------
Optimize TextNodes
Not a great perf optimization, but it makes the node graph simpler which helps when we need to debug templates.
Commits
-------
c44bd1ff Optimize TextNodes
This PR was merged into the 3.x branch.
Discussion
----------
Add tests when a template doesn't have output nodes
refs #3950 cc `@smnandre`
Commits
-------
d53509d4 Add tests when a template doesn't have output nodes
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Remove usage of list() in favor of []
Commits
-------
af8ec178 Remove list() usage in code
9c0897fa Remove usage of list() in favor of []
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
rework the CaptureNode implementation
fixes#3955
Commits
-------
665dce89 rework the CaptureNode implementation
This PR was merged into the 3.x branch.
Discussion
----------
Abstract node capture in its own Node
To prepare the work for #3950, I'd like to abstract the usage of `echo` into a single node that can be reused by other nodes.
The cache node is a good example of defining something that is more semantic are reusable as well. The node itself now just generates the wrapper that can then be returned, echoed, yielded, ...
Commits
-------
6ebbc305 Abstract node capture in its own Node
This PR was merged into the 3.x branch.
Discussion
----------
Improve error message for `constant(FQCN::class)`
It is not obvious that you cannot use the Twig function `constant` to get the special `::class` constants of classes like so: `{{ constant('Twig\\Extension\\CoreExtension::class') }}`, due to the underlying PHP function `\constant()`.
The previous error message
> Constant "Twig\Extension\CoreExtension::class" is undefined.
was generally helpful, but in this special case it was a bit misleading.
An alternative might be to determine and return the FCQN (e.g. via `substr($constant, 0, -7)`), but I'm not sure if this would be too much of a guess.
Commits
-------
3963851a Improve error message
It is not obvious that you cannot use the Twig function `constant` to get the special `::class` constants of classes like so: `{{ constant('Twig\\Extension\\CoreExtension::class') }}`, due to the underlying PHP function `\constant()`.
The previous error message in this case: 'Constant "Twig\Extension\CoreExtension::class" is undefined.' was not very helpful.
This PR was merged into the 3.x branch.
Discussion
----------
Simplify code when using `ob_*` functions
And fixed an edge case (see the modified test).
Commits
-------
0b9e30e3 Simplify code
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Simplify sandbox tests
This allows to remove some unneeded assertions and fix static analysis checks.
Commits
-------
bc22e38c Fix bad merge
e6a98a00 Fix test without any assertions
fca89954 Simplify tests