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 4.x branch.
Discussion
----------
Use proper node names when they are integers
Commits
-------
cde9e7dc Use proper node names when they are integers
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
* 3.x:
Deprecate some internal methods from Parser
Move code from ExtendsTokenParser to Parser
Update Node::__toString() to include the node tag if set
Fix class name
Fix error message
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