diff --git a/src/Node/MacroNode.php b/src/Node/MacroNode.php index 6eeabc27563..ffd6b628d5a 100644 --- a/src/Node/MacroNode.php +++ b/src/Node/MacroNode.php @@ -31,7 +31,7 @@ class MacroNode extends Node public function __construct(string $name, Node $body, Node $arguments, int $lineno, ?string $tag = null) { if (!$body instanceof BodyNode) { - trigger_deprecation('twig/twig', '3.12', sprintf('Not passing a "%s" instance as the "body" argument of the "%s" constructor is deprecated.', BodyNode::class, static::class)); + trigger_deprecation('twig/twig', '3.12', \sprintf('Not passing a "%s" instance as the "body" argument of the "%s" constructor is deprecated.', BodyNode::class, static::class)); } foreach ($arguments as $argumentName => $argument) { diff --git a/src/Node/ModuleNode.php b/src/Node/ModuleNode.php index a6df6b102e5..dc6191e91ee 100644 --- a/src/Node/ModuleNode.php +++ b/src/Node/ModuleNode.php @@ -36,7 +36,7 @@ final class ModuleNode extends Node public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) { if (!$body instanceof BodyNode) { - trigger_deprecation('twig/twig', '3.12', sprintf('Not passing a "%s" instance as the "body" argument of the "%s" constructor is deprecated.', BodyNode::class, static::class)); + trigger_deprecation('twig/twig', '3.12', \sprintf('Not passing a "%s" instance as the "body" argument of the "%s" constructor is deprecated.', BodyNode::class, static::class)); } $nodes = [ diff --git a/src/Node/Node.php b/src/Node/Node.php index 3683dc383b6..a93ac29133e 100644 --- a/src/Node/Node.php +++ b/src/Node/Node.php @@ -82,7 +82,7 @@ public function __toString() } if (\count($this->nodes)) { - $repr .= \sprintf("\n nodes:"); + $repr .= "\n nodes:"; foreach ($this->nodes as $name => $node) { $len = \strlen($name) + 6; $noderepr = []; diff --git a/tests/Node/NodeTest.php b/tests/Node/NodeTest.php index 5a300323026..2a592403433 100644 --- a/tests/Node/NodeTest.php +++ b/tests/Node/NodeTest.php @@ -52,7 +52,7 @@ function: Twig\TwigFunction(a_function) filter: Twig\TwigFilter(a_filter) test: Twig\TwigTest(a_test) EOF - , (string) $node); + , (string) $node); } public function testToStringWithTag() @@ -63,7 +63,7 @@ public function testToStringWithTag() Twig\Node\Node tag: tag EOF - , (string) $node); + , (string) $node); } public function testAttributeDeprecationIgnore()