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
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes#2134).
Discussion
----------
Expanded definition of empty
Based on the [source](https://github.com/twigphp/Twig/blob/f61bc838a97c26e2952af09070d1c4847eeedbe7/lib/Twig/Extension/Core.php#L1405), defined 'empty'. The comment in the code block is too subtle and I didn't notice it until I got to the edit page, and it also does not fully describe the definition of empty based on what the code does.
Commits
-------
9c6b8cb Expanded definition of empty
This PR was merged into the 1.x branch.
Discussion
----------
changed the way we store template source in template classes
In #1807 and #1813, we added a way to get the original template source code from a template. This PR greatly simplifies the approach by removing all the black magic :)
This should also fix#2011
ping @nicolas-grekas
Commits
-------
b55d907 changed the way we store template source in template classes
This PR was merged into the 1.x branch.
Discussion
----------
added missing method on Twig_Template (important for reserved keyword)
Commits
-------
b1f77a4 added missing method on Twig_Template (important for reserved keyword)
This PR was merged into the 1.x branch.
Discussion
----------
removed usage of realpath in cache key
closes#1994
Commits
-------
6f0e3ed removed usage of realpath in cache key
This PR was merged into the 1.x branch.
Discussion
----------
fixed Twig cache sharing when used with different versions of PHP
closes#2013
Commits
-------
ecd020d fixed Twig cache sharing when used with different versions of PHP
This PR was merged into the 1.x branch.
Discussion
----------
fixed a test
While working on #1994, I realize that tests added for #1598 were not useful anymore because of the changes made in #1686. This PR fixes that.
Commits
-------
85fb2a1 fixed a test
This PR was merged into the 1.x branch.
Discussion
----------
fixed embed parent token for simple use cases
Not the most elegant solution but solves the problem for when `embed` is used on a non-dynamic template, which should cover almost all use cases.
Commits
-------
a048985 fixed embed parent token for simple use cases
a9082dd fixed typo
This PR was merged into the 1.x branch.
Discussion
----------
deprecated the ability to store non Node instances in Node::$nodes
Commits
-------
03f18b4 enforced Node:: to only contain node instances
This PR was merged into the 1.x branch.
Discussion
----------
changed the way we store node filenames
Commits
-------
4c4657a changed the way we store node filenames
This PR was merged into the 1.x branch.
Discussion
----------
deprecated some more methods on Twig_Environment
These methods are sometimes misused (#2020) when called from a template context (Twig_Template::getEnv() has been deprecated as well, but #2106 might re-introduce it).
Anyway, Twig_Environment should not act as a container, so, being able to change the defaults make sense, but retrieving them probably not.
Commits
-------
e548cbe deprecated some more methods on Twig_Environment
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_Compiler::getFilename()
Using `Twig_Compiler::getFilename()` is very fragile as depending on when it is called, the returned value can be very different (depending on template compilation that can have occurred in between).
see #2020 for such a wrong usage.
Commits
-------
1f41e9f deprecated Twig_Compiler::getFilename()
This PR was merged into the 1.x branch.
Discussion
----------
changed a test to make it more robust
Commits
-------
ec7a1c1 changed a test to make it more robust
This PR was squashed before being merged into the 1.x branch (closes#2105).
Discussion
----------
Floor - use cast and not intval
Use cast in fav. of the `inval`, because;
- its faster
- cannot be overloaded
- less chars
Commits
-------
39d46ac Floor - use cast and not intval