From d0e0505204193105a63933c4e0028d1c240297d1 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 27 Dec 2022 04:20:37 +0100 Subject: [PATCH] Latte: {inputError} must have argument --- src/Bridges/FormsLatte/Nodes/InputErrorNode.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Bridges/FormsLatte/Nodes/InputErrorNode.php b/src/Bridges/FormsLatte/Nodes/InputErrorNode.php index ba2767a61..014e16d69 100644 --- a/src/Bridges/FormsLatte/Nodes/InputErrorNode.php +++ b/src/Bridges/FormsLatte/Nodes/InputErrorNode.php @@ -9,7 +9,6 @@ namespace Nette\Bridges\FormsLatte\Nodes; -use Latte\Compiler\Nodes\Php\Expression\VariableNode; use Latte\Compiler\Nodes\Php\ExpressionNode; use Latte\Compiler\Nodes\StatementNode; use Latte\Compiler\PrintContext; @@ -27,13 +26,10 @@ class InputErrorNode extends StatementNode public static function create(Tag $tag): static { $tag->outputMode = $tag::OutputKeepIndentation; + $tag->expectArguments(); + $node = new static; - if ($tag->parser->isEnd()) { - trigger_error("Missing argument in {inputError} (on line {$tag->position->line})", E_USER_DEPRECATED); - $node->name = new VariableNode('ʟ_input'); - } else { - $node->name = $tag->parser->parseUnquotedStringOrExpression(); - } + $node->name = $tag->parser->parseUnquotedStringOrExpression(); return $node; }