This commit is contained in:
Fabien Potencier
2024-09-06 12:33:38 +02:00
parent b1cdda25c6
commit 2ae0c0d38c
14 changed files with 31 additions and 30 deletions
+3 -3
View File
@@ -29,10 +29,10 @@ class ImportNode extends Node
*/
public function __construct(AbstractExpression $expr, AbstractExpression $var, int $lineno, $global = true)
{
if (null === $global || is_string($global)) {
if (null === $global || \is_string($global)) {
trigger_deprecation('twig/twig', '3.12', 'Passing a tag to %s() is deprecated.', __METHOD__);
$global = func_num_args() > 4 ? func_get_arg(4) : true;
} elseif (!is_bool($global)) {
$global = \func_num_args() > 4 ? func_get_arg(4) : true;
} elseif (!\is_bool($global)) {
throw new \TypeError(\sprintf('Argument 4 passed to "%s()" must be a boolean, "%s" given.', __METHOD__, get_debug_type($global)));
}