Skip to content

Commit

Permalink
Latte: {inputError} must have argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 8, 2024
1 parent d3204f2 commit d0e0505
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Bridges/FormsLatte/Nodes/InputErrorNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit d0e0505

Please sign in to comment.