This PR was merged into the 1.x branch.
Discussion
----------
marked Twig_TokenStream::getSource() as being internal
Commits
-------
4b1573b marked Twig_TokenStream::getSource() as being internal
This PR was merged into the 1.x branch.
Discussion
----------
removed template source code for generated template classes when debug is disabled
Commits
-------
7a04767 removed template source code for generated template classes when debug is disabled
This PR was merged into the 1.x branch.
Discussion
----------
fixed regression on static calls for functions/filters/tests
fixes#2160
What about deprecate this possibility? Using `__call()`/`__staticCall()` means that we don't support named arguments for instance.
Commits
-------
e01c29b fixed regression on static calls for functions/filters/tests
This PR was merged into the 1.x branch.
Discussion
----------
default implementation of getDebugInfo() for BC
eZ updated the code on their side in the meantime (see ezsystems/LegacyBridge#63), but there may be other projects doing similar things (fixes https://github.com/twigphp/Twig/pull/2129#discussion_r80250969).
Commits
-------
7b4cfdb default implementation of getDebugInfo() for BC
This PR was merged into the 1.x branch.
Discussion
----------
[WIP] Take into account passed options when generating cache key (closes#1604)
Cache depends on options like optimization or debug mode. If we generate different cache files depends on php version or enabled extensions - we can take into account options with wich env was created.
Commits
-------
9f3cfc3 Take into account passed options when generating cache key (closes#1604)
This PR was squashed before being merged into the 1.x branch (closes#2152).
Discussion
----------
normalizePath: Do not mangle phar URLs.
Removing consecutive slashes breaks phar URLs. Example:
phar:///foo/bar is turned into phar:/foo/bar.
This change preserves the three slashes if path starts with phar://.
Commits
-------
7dd63fc normalizePath: Do not mangle phar URLs.
This PR was merged into the 1.x branch.
Discussion
----------
added runtime extensions
Commits
-------
9cb6860 allowed filters/functions/tests implementation to use a different class than the extension they belong to
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_ExtensionInterface::getName()
see #2147
Commits
-------
71f03df deprecated Twig_ExtensionInterface::getName()
This PR was merged into the 1.x branch.
Discussion
----------
added some missing tests for functions/filters as static calls
Commits
-------
c73e97e added some missing tests for functions/filters as static calls
This PR was merged into the 1.x branch.
Discussion
----------
added a recipe about how to use Twig and AngularJS together
Commits
-------
b162a91 added a recipe about how to use Twig and AngularJS together
This PR was merged into the 1.x branch.
Discussion
----------
added a missing deprecation notice
Commits
-------
9c27479 added a missing deprecation notice
This PR was merged into the 1.x branch.
Discussion
----------
fixed exception message that might end with a ?
Commits
-------
5c43548 adding missing dots to some exception messages
fbf99fc fixed exception message that might end with a ?
This PR was squashed before being merged into the 1.x branch (closes#2139).
Discussion
----------
Improved the error message when a child template defines contents outside parent blocks
### Context
When using template inheritance, you cannot put template contents outside Twig blocks (except some special tags (form_theme), macros, etc.) Sadly, making this mistake is very common when learning Twig.
### Problem
The error message associated to this issue is cryptic and "impossible to understand" for newcomers:
```
A template that extends another one cannot have a body.
```
I recently delivered a Symfony training and nobody was able to understand what the error was. They didn't have the slightest clue. I explained it to them ... and a few days latter they had the same problem and again they couldn't remember what this error was related to.
### Solution
Most of the Twig/Symfony errors are very helpful. Let's improve this one to make it useful too.
Two years ago I tried to fix this error message (see #1396). Let's see if this new PR is accepted.
Commits
-------
23f53d5 Improved the error message when a child template defines contents outside parent blocks