This PR was merged into the 3.x branch.
Discussion
----------
Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
Commits
-------
5fca700c Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
This PR was merged into the 3.x branch.
Discussion
----------
Clarify block function
It actually renders the block again.
Commits
-------
8c3df0c0 Clarify block function
This PR was merged into the 3.x branch.
Discussion
----------
Fix CoreExtension::captureOutput
Fix#4146
I forgot these lines in #4216
Commits
-------
7ba68667 Fix CoreExtension::captureOutput
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Mark implicit macro argument default values as such with an attribute in AST
This change causes no difference to compiled templates or to macro argument semantics.
Consider the following macro:
```twig
{% macro marco(po, lo = null) %}{% endmacro %}
```
With this change, the `ConstantExpression` for argument `po` will have an attribute `is_implicit`, whose value will be `true`. (Note that `lo` will not have that attribute.)
This allows node visitors to distinguish between arguments that do and those that do not have explicit default values even if the value is `null`.
This is useful for [static code analysis](https://github.com/twigphp/Twig/issues/4003).
For example, a static analysis tool might consider arguments with no explicit default value as non-optional.
Commits
-------
e83a8028 Mark implicit macro argument default values as such with an attribute in AST
This PR was merged into the 3.x branch.
Discussion
----------
Fix two-word tests precedence over one-word tests
Closes#3282
Commits
-------
58d5780e Fix two-word tests precedence over one-word tests
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate the spaceless filter
Closes#3576
Deprecate the `spaceless` filter for the following reasons:
* The performance is bad (as the work is done at runtime via a regexp)
* Optimizing the size of an HTML doc server side is "almost never" a good idea (compression is better and enough)
* There are some edge cases where you want to keep some spaces (see #3576)
* Controlling whitespace is possible and fine-grained via the dedicated Twig modifiers on `{{ }}`
If someone find it useful, re-creating it is trivial (`return trim(preg_replace('/>\s+</', '><', $content ?? ''));`),
but with so many caveats and not so many use cases, I think it does not belong to core.
Commits
-------
9fd4c487 Deprecate the spaceless filter
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate some internal methods from Parser
Commits
-------
9e6c4a6a Deprecate some internal methods from Parser
This PR was merged into the 3.x branch.
Discussion
----------
Move code from ExtendsTokenParser to Parser
Commits
-------
cf472760 Move code from ExtendsTokenParser to Parser
This PR was merged into the 3.x branch.
Discussion
----------
Update Node::__toString() to include the node tag if set
Commits
-------
157d36ae Update Node::__toString() to include the node tag if set
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate returning null from TokenParserInterface::parse()
Commits
-------
0c751361 Deprecate returning null from TokenParserInterface::parse()
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 merged into the 3.x branch.
Discussion
----------
ChainLoader constructor should accept iterable instead of array
Closes#4200
Commits
-------
6ef13d1eResolves#4200