This PR was merged into the 1.x branch.
Discussion
----------
Use v5.0 of the phpunit bridge
Not critical but still better IMHO :)
Commits
-------
2e6f74af Use v5.0 of the phpunit bridge
This PR was squashed before being merged into the 2.x branch (closes#3025).
Discussion
----------
Add the possibility to register classes/interface as being safe
closes#2548
To avoid a too big performance impact on the escaper, we aggressively cache the safe classes, which means that changing the. configuration at runtime is not possible (and having different ones on 2 Twig instances is not possible either, this is really *globally* configured).
Commits
-------
fe6503fe -
b18733bc added the possibility to register classes/interfaces as being safe for the escaper
* 1.x:
tweaked docs
Add information for when `filter` filter was added in 2.x branch
tweaked docs
doc(filter): add example of `filter` without `for` use
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#3027).
Discussion
----------
Add information for when `filter` filter was added in 2.x branch
The current "versionadded" info can be confusing to developers, if they assume 2.9 > 1.41 and don't know that 1.x and 2.x branches are still developed simultaneously.
Commits
-------
a05da6db Add information for when `filter` filter was added in 2.x branch
The current "versionadded" info can be confusing to developers, if they assume 2.9 > 1.41 and don't know that 1.x and 2.x branches are still developed simultaneously.
This PR was merged into the 2.x branch.
Discussion
----------
Deprecate CoreExtension::setEscaper() and CoreExtension::getEscaper() in favor of the same methods on EscaperExtension
This is some preliminary work to ease #3025. Everything related to escaping is now part of the `EscaperExtension` instead of `CoreExtension`. This PR is submitted on 2.x because both extensions are always available in 2.x (which is not the case on 1.x).
Commits
-------
59d1d5d4 deprecated CoreExtension::setEscaper() and CoreExtension::getEscaper() in favor of the same methods on EscaperExtension
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes#3024).
Discussion
----------
doc(filter): add example of `filter` without `for` use
First, thanks for #2996! :)
This PR add an example of `filter` usage without using a `for` loop, to prevend some misinterpretation to people.
At first read, I thought `filter` was only usable with `for` loop, but nope. In fact it iterates on the result produced by `filter`.
Commits
-------
847276a6 doc(filter): add example of `filter` without `for` use
This PR was squashed before being merged into the 2.x branch (closes#3019).
Discussion
----------
Local macros auto-import
closes#1758, closes#861
This implements auto-import for macros defined in a template. To avoid BC breaks, I've decided to do the auto-import as the equivalent of `{% import _self as _self %}`, so local macros are loaded under the `_self` pseudo-variable:
```twig
{{ _self.hello("Fabien") }}
{% macro hello(name) -%}
Hello {{ name }}
{% endmacro %}
```
~~Note that this is done via a new extension that you need to explicitly enable for now. We can remove the need for the extension, just not sure if we want it. WDYT?~~
Commits
-------
3fcbc442 Local macros auto-import
This PR was merged into the 2.x branch.
Discussion
----------
Add a better error message for unknown macros
Commits
-------
1153534a added a better error message for unknown macros
This PR was merged into the 1.x branch.
Discussion
----------
Fix the "filter" filter when the argument is \Traversable but does not implement \Iterator
close#3015, closes#3016
Commits
-------
c2f685e1 fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator