Skip to content

Commit

Permalink
deprecated Parser::isReservedMacroName()
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Feb 15, 2019
1 parent 185a11d commit 85972a0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* 2.6.3 (2019-XX-XX)
* 2.7.0 (2019-XX-XX)

* n/a
* deprecated Twig_Parser::isReservedMacroName()

* 2.6.2 (2019-01-14)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
"dev-master": "2.7-dev"
}
}
}
7 changes: 7 additions & 0 deletions doc/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ The following classes are marked as ``@final`` in Twig 2 and will be final in
* ``Twig\TwigFunction``
* ``Twig\TwigTest``
* ``Twig\Profiler\Profile``

Parser
------

* As of Twig 2.7, the ``Twig_Parser::isReservedMacroName()`` / ``Twig\Parser``
function is deprecated and will be removed in Twig 3.0. It always returns
``false`` anyway as Twig 2 does not have any reserved macro names.
8 changes: 4 additions & 4 deletions lib/Twig/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
*/
class Twig_Environment
{
const VERSION = '2.6.3-DEV';
const VERSION_ID = 20603;
const VERSION = '2.7.0-DEV';
const VERSION_ID = 20700;
const MAJOR_VERSION = 2;
const MINOR_VERSION = 6;
const RELEASE_VERSION = 3;
const MINOR_VERSION = 7;
const RELEASE_VERSION = 0;
const EXTRA_VERSION = 'DEV';

private $charset;
Expand Down
5 changes: 5 additions & 0 deletions lib/Twig/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,13 @@ public function setMacro($name, Twig_Node_Macro $node)
$this->macros[$name] = $node;
}

/**
* @deprecated since 2.7 as there are no reserved macro names anymore, will be removed in 3.0.
*/
public function isReservedMacroName($name)
{
@trigger_error(sprintf('The "%s" method is deprecated since Twig 2.7 and will be removed in 3.0.', __METHOD__), E_USER_DEPRECATED);

return false;
}

Expand Down

0 comments on commit 85972a0

Please sign in to comment.