From 26256fc4880fc9c94902abedc6338b23dc3c012f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 18 Oct 2024 11:16:02 +0200 Subject: [PATCH] reduce the deprecation noise when more than one argument is passed When more than one argument is passed to parseArguments(), one deprecation is triggered for each argument. Since passing any argument is deprecated the number of triggered deprecations can be reduced for more than one argument being passed. --- src/ExpressionParser.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ExpressionParser.php b/src/ExpressionParser.php index 51a10f4f2..23ecb43a8 100644 --- a/src/ExpressionParser.php +++ b/src/ExpressionParser.php @@ -697,15 +697,11 @@ class ExpressionParser { $namedArguments = false; $definition = false; - if (func_num_args() > 2) { - trigger_deprecation('twig/twig', '3.15', 'Passing a third argument ($allowArrow) to "%s()" is deprecated.', __METHOD__); - } if (func_num_args() > 1) { - trigger_deprecation('twig/twig', '3.15', 'Passing a second argument ($definition) to "%s()" is deprecated.', __METHOD__); $definition = func_get_arg(1); } if (func_num_args() > 0) { - trigger_deprecation('twig/twig', '3.15', 'Passing a first argument ($namedArguments) to "%s()" is deprecated.', __METHOD__); + trigger_deprecation('twig/twig', '3.15', 'Passing arguments to "%s()" is deprecated.', __METHOD__); $namedArguments = func_get_arg(0); }