-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
fixed Twig deprecation notices #16331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -29,12 +29,18 @@ class TwigRendererEngine extends AbstractRendererEngine implements TwigRendererE | |||
*/ | |||
private $template; | |||
|
|||
public function __construct(array $defaultThemes = array(), \Twig_Environment $environment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we have the BC break as the environment is now required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which breaks Silex for instance.
I can see two other options:
|
I don't know if it's relevant here (I read quickly), but we didn't try to avoid deprecation notices in 2.3. |
@@ -15,6 +15,8 @@ | |||
|
|||
/** | |||
* @author Bernhard Schussek <bschussek@gmail.com> | |||
* | |||
* @deprecated Deprecated in 2.8, to be removed in 3.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should not be new deprecatations in a maintanance branch. This PR is for 2.3
9dd07b0
to
1bdd127
Compare
Totally new implementation where I just implement the new interface from twigphp/Twig#1886. Another PR for 2.8 does the other changes (see #16333). |
@@ -21,7 +21,7 @@ | |||
* @author Fabien Potencier <fabien@symfony.com> | |||
* @author Bernhard Schussek <bschussek@gmail.com> | |||
*/ | |||
class FormExtension extends \Twig_Extension | |||
class FormExtension extends \Twig_Extension implements \Twig_Extension_InitRuntimeInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this interface defined? Travis fails when trying to load it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, I missed the link to twigphp/Twig#1886.
👍 Status: Reviewed Can we merge here to make Travis builds pass again? |
I need to release Twig 1.23 first. |
@@ -34,7 +34,7 @@ | |||
"symfony/process": "~2.0,>=2.0.5", | |||
"symfony/validator": "~2.2", | |||
"symfony/yaml": "~2.0,>=2.0.5", | |||
"twig/twig": "~1.20|~2.0" | |||
"twig/twig": "~1.23|~2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed? The LogoutUrlExtension
does not make use of the setEnvironment()
method.
This PR was merged into the 2.3 branch. Discussion ---------- fixed Twig deprecation notices | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a To avoid deprecation notices when upgrading to Twig 1.23. Commits ------- 1bdd127 fixed Twig deprecation notices
@fabpot @nicolas-grekas This produces a deprecation warning through the DebugClassLoader on every request in symfony standard edition.
|
|
This happens when using the dev version of Twig 2.0 I guess (the interface is not tagged as deprecated in Twig 1.23, is it?). |
To avoid deprecation notices when upgrading to Twig 1.23.