Skip to content

Commit

Permalink
fix version numbers for deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Dec 2, 2024
1 parent 6cc64f2 commit f09dd80
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# 3.17.0 (2024-XX-XX)

* n/a
* 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 f09dd80

Please sign in to comment.