Deprecate CallExpression::compileArguments

This commit is contained in:
Fabien Potencier
2024-06-17 11:22:10 +02:00
parent ab071efe3b
commit 71d6c82de6
3 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
# 3.10.4 (2024-XX-XX)
# 3.11.0 (2024-XX-XX)
* n/a
* Deprecate the second argument of `Twig\Node\Expression\CallExpression::compileArguments()`
# 3.10.3 (2024-05-16)
+7
View File
@@ -32,6 +32,13 @@ Extensions
After:
$twig->getRuntime(EscaperRuntime::class)->METHOD();
Nodes
-----
* The second argument of the
``Twig\Node\Expression\CallExpression::compileArguments()`` method is
deprecated.
Node Visitors
-------------
+4
View File
@@ -57,6 +57,10 @@ abstract class CallExpression extends AbstractExpression
protected function compileArguments(Compiler $compiler, $isArray = false): void
{
if (func_num_args() >= 2) {
trigger_deprecation('twig/twig', '3.11', 'Passing a second argument to "%s()" is deprecated.', __METHOD__);
}
$compiler->raw($isArray ? '[' : '(');
$first = true;