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 Oct 29, 2023
1 parent 9b32b41 commit a29698a
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 a29698a

Please sign in to comment.