Deprecate TwigRendererEngine::setEnvironment()

This commit is contained in:
Robin Chalas 2016-12-22 11:31:59 +01:00
parent d29fc2ca9e
commit aabb73cab8
3 changed files with 15 additions and 0 deletions

View File

@ -38,3 +38,9 @@ SecurityBundle
* The `FirewallContext::getContext()` method has been deprecated and will be removed in 4.0. * The `FirewallContext::getContext()` method has been deprecated and will be removed in 4.0.
Use the `getListeners()` method instead. Use the `getListeners()` method instead.
TwigBridge
----------
* The `TwigRendererEngine::setEnvironment()` method has been deprecated and will be removed
in 4.0. Pass the Twig Environment as second argument of the constructor instead.

View File

@ -217,6 +217,9 @@ TwigBridge
* The possibility to inject the Form Twig Renderer into the form extension * The possibility to inject the Form Twig Renderer into the form extension
has been removed. Inject it into the `TwigRendererEngine` instead. has been removed. Inject it into the `TwigRendererEngine` instead.
* The `TwigRendererEngine::setEnvironment()` method has been removed.
Pass the Twig Environment as second argument of the constructor instead.
Validator Validator
--------- ---------

View File

@ -41,9 +41,15 @@ class TwigRendererEngine extends AbstractRendererEngine implements TwigRendererE
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @deprecated since version 3.3, to be removed in 4.0
*/ */
public function setEnvironment(\Twig_Environment $environment) public function setEnvironment(\Twig_Environment $environment)
{ {
if ($this->environment) {
@trigger_error(sprintf('The "%s()" method is deprecated since version 3.3 and will be removed in 4.0. Pass the Twig Environment as second argument of the constructor instead.', __METHOD__), E_USER_DEPRECATED);
}
$this->environment = $environment; $this->environment = $environment;
} }