This PR was merged into the 2.x branch.
Discussion
----------
remove condition on PHP version
Twig now requires PHP >= 7 so there is no need to check for prior version.
Commits
-------
df185584 remove condition on PHP version
This PR was merged into the 2.x branch.
Discussion
----------
Typehint the function, filter and test names as string
This gives faster feedback when using the class in a wrong way, instead of getting a ``Warning: Illegal offset type in ExtensionSet.php line 434`` during the function registration (see https://github.com/symfony/symfony/issues/21212 for a case getting this message)
Commits
-------
2b4642c3 Typehint the function, filter and test names as string
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes#2322).
Discussion
----------
Minor typo in class name
Commits
-------
ce90852 Minor typo in class name
This PR was squashed before being merged into the 1.x branch (closes#2265).
Discussion
----------
Optimize usage of Traversable/Iterator
Commits
-------
2bdcfb6 Optimize usage of Traversable/Iterator
This PR was merged into the 2.x branch.
Discussion
----------
removed remaining mentions of the C extension
Commits
-------
57ebf00 removed remaining mentions of the C extension
This PR was merged into the 1.x branch.
Discussion
----------
fix C89 compat
@tucksaun @fabpot The extension did not compile anymore with old MSVC compilers. This PR contains the fix.
Commits
-------
c6be57f fix C89 compat
This PR was merged into the 2.x branch.
Discussion
----------
moved Twig_Template::getAttribute() to a function
Commits
-------
6405684 moved Twig_Template::getAttribute() to a function
This PR was merged into the 2.x branch.
Discussion
----------
modified code to use variadics when possible
Commits
-------
a002d59 modified code to use variadics when possible
This PR was merged into the 1.x branch.
Discussion
----------
Add a simple Twig_RuntimeLoaderInterface implementation
Next to https://github.com/symfony/symfony/pull/21023
This is related to the BC break reported in symfony/symfony#21008 which has been introduced in symfony/symfony#20093 when decoupling extensions from definitions.
What I propose here is to ease the upgrade to symfony 3.2+ by adding a simple `Twig_RuntimeLoaderInterface` implementation here, useful only when using the twig-bridge outside of the symfony fullstack framework (with the Form component for instance).
Upgrading would be as simple as:
```diff
$twig = new Twig_Environment(...);
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig);
- $twig->addExtension(new FormExtension(new TwigRenderer($rendererEngine, $csrfTokenManager)));
+ $twig->addExtension(new FormExtension());
+ $twig->addRuntimeLoader(new Twig_RuntimeLoader(array(TwigRenderer::class => new TwigRenderer($rendererEngine, $csrfTokenManager)));
```
Instead of having to write this runtime loader yourself.
Please see symfony/symfony#21008 for details and a concrete example of how this could help.
Commits
-------
91c8d59 Add a Twig_FactoryRuntimeLoader
This PR was merged into the 1.x branch.
Discussion
----------
add a comma to clarify the meaning
Without the comma you could understand that the "if" not only applied
to `-1`, but to `1` as well if you read too quickly.
Commits
-------
7cd3c9d add a comma to clarify the meaning