Skip to content

Commit

Permalink
deprecated Twig_Template::getEnvironment()
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Aug 12, 2015
1 parent 1eb5fb2 commit c9501b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,5 +1,6 @@
* 1.20.0 (2015-XX-XX)

* deprecated Twig_Template::getEnvironment()
* deprecated the _self variable for usage outside of the from and import tags
* added Twig_BaseNodeVisitor to ease the compatibility of node visitors
between 1.x and 2.x
Expand Down
4 changes: 4 additions & 0 deletions doc/deprecated.rst
Expand Up @@ -130,3 +130,7 @@ Miscellaneous

* As of Twig 1.x, ``Twig_Environment::clearTemplateCache()`` is deprecated and
will be removed in 2.0.

* As of Twig 1.x, ``Twig_Template::getEnvironment()`` and
``Twig_TemplateInterface::getEnvironment()`` are deprecated and will be
removed in 2.0.
4 changes: 3 additions & 1 deletion lib/Twig/Template.php
Expand Up @@ -45,10 +45,12 @@ public function __construct(Twig_Environment $env)
abstract public function getTemplateName();

/**
* {@inheritdoc}
* @deprecated since 1.20 (to be removed in 2.0)
*/
public function getEnvironment()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.20 and will be removed in 2.0.', E_USER_DEPRECATED);

return $this->env;
}

Expand Down

0 comments on commit c9501b8

Please sign in to comment.