Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Add a way to mark a `Twig\Markup` instance as safe for some escaping strategies only
* Make `Environment::getExtension()` return the runtime of an extension class registered with `AttributeExtension`
* Make `Environment::getRuntime()` fall back to the registered extension of the same class
* Speed up creating filter, function, and test nodes

# 3.30.0 (2026-09-25)

Expand Down
21 changes: 12 additions & 9 deletions src/Node/Expression/FilterExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ public function __construct(Node $node, TwigFilter|ConstantExpression $filter, N
$this->setAttribute('twig_callable', $filter);
}

$this->deprecateNode('filter', new NameDeprecation('twig/twig', '3.12'));

$this->deprecateAttribute('needs_charset', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('needs_environment', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('needs_context', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('arguments', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('callable', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('is_variadic', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('dynamic_name', new NameDeprecation('twig/twig', '3.12'));
static $deprecation;
$deprecation ??= new NameDeprecation('twig/twig', '3.12');

$this->deprecateNode('filter', $deprecation);

$this->deprecateAttribute('needs_charset', $deprecation);
$this->deprecateAttribute('needs_environment', $deprecation);
$this->deprecateAttribute('needs_context', $deprecation);
$this->deprecateAttribute('arguments', $deprecation);
$this->deprecateAttribute('callable', $deprecation);
$this->deprecateAttribute('is_variadic', $deprecation);
$this->deprecateAttribute('dynamic_name', $deprecation);
}

public function compile(Compiler $compiler): void
Expand Down
17 changes: 10 additions & 7 deletions src/Node/Expression/FunctionExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ public function __construct(TwigFunction|string $function, Node $arguments, int
$this->setAttribute('twig_callable', $function);
}

$this->deprecateAttribute('needs_charset', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('needs_environment', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('needs_context', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('arguments', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('callable', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('is_variadic', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('dynamic_name', new NameDeprecation('twig/twig', '3.12'));
static $deprecation;
$deprecation ??= new NameDeprecation('twig/twig', '3.12');

$this->deprecateAttribute('needs_charset', $deprecation);
$this->deprecateAttribute('needs_environment', $deprecation);
$this->deprecateAttribute('needs_context', $deprecation);
$this->deprecateAttribute('arguments', $deprecation);
$this->deprecateAttribute('callable', $deprecation);
$this->deprecateAttribute('is_variadic', $deprecation);
$this->deprecateAttribute('dynamic_name', $deprecation);
}

public function enableDefinedTest(): void
Expand Down
11 changes: 7 additions & 4 deletions src/Node/Expression/TestExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ public function __construct(Node $node, string|TwigTest $test, ?Node $arguments,
$this->setAttribute('twig_callable', $test);
}

$this->deprecateAttribute('arguments', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('callable', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('is_variadic', new NameDeprecation('twig/twig', '3.12'));
$this->deprecateAttribute('dynamic_name', new NameDeprecation('twig/twig', '3.12'));
static $deprecation;
$deprecation ??= new NameDeprecation('twig/twig', '3.12');

$this->deprecateAttribute('arguments', $deprecation);
$this->deprecateAttribute('callable', $deprecation);
$this->deprecateAttribute('is_variadic', $deprecation);
$this->deprecateAttribute('dynamic_name', $deprecation);
}

public function compile(Compiler $compiler): void
Expand Down
Loading