Skip to content

Commit

Permalink
minor #4492 fix version numbers for deprecations (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

fix version numbers for deprecations

#4482 was merged after the release of 3.16.0

Commits
-------

f90105d fix version numbers for deprecations
  • Loading branch information
fabpot committed Dec 2, 2024
2 parents e1a5aa1 + f90105d commit 57bf519
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 3.17.0 (2024-XX-XX)

* Support underscores in number literals
* Deprecate `ConditionalExpression` and `NullCoalesceExpression` (use `ConditionalTernary` and `NullCoalesceBinary` instead)

# 3.16.0 (2024-11-29)

* Deprecate `ConditionalExpression` and `NullCoalesceExpression` (use `ConditionalTernary` and `NullCoalesceBinary` instead)
* Deprecate `InlinePrint`
* Fix having macro variables starting with an underscore
* Deprecate not passing a `Source` instance to `TokenStream`
Expand Down
4 changes: 2 additions & 2 deletions doc/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ Nodes
replacement.

* The ``Twig\Node\Expression\NullCoalesceExpression`` class is deprecated as
of Twig 3.16, use ``Twig\Node\Expression\Binary\NullCoalesceBinary``
of Twig 3.17, use ``Twig\Node\Expression\Binary\NullCoalesceBinary``
instead.

* The ``Twig\Node\Expression\ConditionalExpression`` class is deprecated as of
Twig 3.16, use ``Twig\Node\Expression\Ternary\ConditionalTernary`` instead.
Twig 3.17, use ``Twig\Node\Expression\Ternary\ConditionalTernary`` instead.

Node Visitors
-------------
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Expression/ConditionalExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ConditionalExpression extends AbstractExpression implements OperatorEscape
{
public function __construct(AbstractExpression $expr1, AbstractExpression $expr2, AbstractExpression $expr3, int $lineno)
{
trigger_deprecation('twig/twig', '3.16', \sprintf('"%s" is deprecated; use "%s" instead.', __CLASS__, ConditionalTernary::class));
trigger_deprecation('twig/twig', '3.17', \sprintf('"%s" is deprecated; use "%s" instead.', __CLASS__, ConditionalTernary::class));

parent::__construct(['expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3], [], $lineno);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Expression/NullCoalesceExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class NullCoalesceExpression extends ConditionalExpression
*/
public function __construct(Node $left, Node $right, int $lineno)
{
trigger_deprecation('twig/twig', '3.16', \sprintf('"%s" is deprecated; use "%s" instead.', __CLASS__, NullCoalesceBinary::class));
trigger_deprecation('twig/twig', '3.17', \sprintf('"%s" is deprecated; use "%s" instead.', __CLASS__, NullCoalesceBinary::class));

if (!$left instanceof AbstractExpression) {
trigger_deprecation('twig/twig', '3.15', 'Not passing a "%s" instance to the "left" argument of "%s" is deprecated ("%s" given).', AbstractExpression::class, static::class, \get_class($left));
Expand Down

0 comments on commit 57bf519

Please sign in to comment.