This PR was merged into the 1.x branch.
Discussion
----------
Fixing a slight typo in interface
Just a typo in the ExtensionInterface
Commits
-------
de15975 Fixing a slight typo in interface
This PR was merged into the 1.x branch.
Discussion
----------
Code grooming
Commits
-------
aa7c53a Add dot to the end of exception messages.
b8a6e72 set back default
0f5f9aa Typo in doc
8bb9b83 CS
355213b static vs. self
d4e3ada Code grooming
This PR was merged into the 1.x branch.
Discussion
----------
made exception messages more precise
Replaces #1906 and #1902
Commits
-------
04d6738 fixed typos
This PR was merged into the 1.x branch.
Discussion
----------
fix BC, revert to pre 1.23 behavior, and make use of pattern an option
For context see twigphp/Twig-extensions#155
Commits
-------
ee5e25e fix BC, revert to pre 1.23 behavior, and make use of pattern an option
This PR was merged into the 1.x branch.
Discussion
----------
fixed Twig_Extension_GlobalsInterface name in comments
It looks like renaming `Twig_Extension_GlobalsProviderInterace` to `Twig_Extension_GlobalsInterface` was done only partially while working on #1897.
Commits
-------
2660286 fixed Twig_Extension_GlobalsInterface name in comments
This PR was merged into the 1.x branch.
Discussion
----------
make cache per user (on linux)
Just because I hate having failed test when I run test once on 1 account, then once on another account ;)
Commits
-------
da5cac6 make cache per user (on linux)
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_ExtensionInterface::getGlobals()
Commits
-------
e3a325f deprecated Twig_ExtensionInterface::getGlobals()
This PR was merged into the 1.x branch.
Discussion
----------
deprecated the possibility to override an extension by registering an other one with the same name
Commits
-------
72485c2 deprecated the possibility to override an extension by registering another one with the same name
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_ExtensionInterface::initRuntime()
I'm working on splitting Twig extensions into 2 different phases: compilation and runtime. The goal is to avoid having to load the runtime environment of an extension when compiling templates. That also opens the way to be able to lazy-load Twig extensions.
While working on the split, I realized that the `initRuntime()` method on `Twig_ExtensionInterface` is not needed anymore. It was added at a time `needs_environment` did not exist and was a way to keep the environment around for custom filters/tests/functions. But nowadays, that's not needed anymore. I did a quick search on Github, and most of the implementation I found just store the environment in a local property, which is not needed anymore. So, I propose to deprecate it in 1.x and remove it in 2.0.
Commits
-------
9774f4f deprecated Twig_ExtensionInterface::initRuntime()
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_Environment::computeAlternatives()
Commits
-------
d0a5ef8 deprecated Twig_Environment::computeAlternatives()
This PR was merged into the 1.x branch.
Discussion
----------
made the tests semantically more correct
Calling `initRuntime()` is just a side-effect of loading a template.
Commits
-------
f839ad3 made the tests semantically more correct
This PR was merged into the 1.x branch.
Discussion
----------
Fix adding mock extension to Twig environment
When the extension class is not defined in a file but in eval'd code we cannot assume `ReflectionObject::getFileName()` will return a valid file path.
https://bugs.php.net/bug.php?id=63901
This PR adds a test case that produce the following error without the fix:
```
1) Twig_Tests_EnvironmentTest::testAddMockExtension
filemtime(): stat failed for phar:///usr/local/php5-5.5.14-20140628-105310/bin/phpunit/phpunit-mock-objects/Framework/MockObject/Generator.php(335) : eval()'d code
/xxx/Twig/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:40
/xxx/Twig/lib/Twig/Environment.php:769
/xxx/Twig/test/Twig/Tests/EnvironmentTest.php:304
```
I encountered this issue with mocked twig extensions in SonataAdminBundle test suite:
https://github.com/sonata-project/SonataAdminBundle/blob/master/Tests/Controller/HelperControllerTest.php#L254
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #1870
| License | MIT
| Doc PR | n/a
Commits
-------
a57b1cc Fix adding mock extension to Twig environment
When the extension class is not defined in a file but in eval'd code
we cannot assume ReflectionObject::getFileName will return
a valid file path.
https://bugs.php.net/bug.php?id=63901
This PR was merged into the 1.x branch.
Discussion
----------
removed obsolete documentation about requiring classes
Commits
-------
eac8c0c removed obsolete documentation about requiring classes