From 28fbd0126c31f3d87a85b853eec8119e9de48068 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 8 Nov 2023 22:35:50 +0100 Subject: [PATCH] Latte: sets Tag::$node --- composer.json | 4 ++-- src/Bridges/FormsLatte/Nodes/FieldNNameNode.php | 2 +- src/Bridges/FormsLatte/Nodes/FormContainerNode.php | 2 +- src/Bridges/FormsLatte/Nodes/FormNNameNode.php | 2 +- src/Bridges/FormsLatte/Nodes/FormNode.php | 2 +- src/Bridges/FormsLatte/Nodes/LabelNode.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 9acf463c5..d1360db24 100644 --- a/composer.json +++ b/composer.json @@ -24,12 +24,12 @@ "nette/application": "^3.0", "nette/di": "^3.0", "nette/tester": "^2.4", - "latte/latte": "^2.10.2 || ^3.0.8", + "latte/latte": "^2.10.2 || ^3.0.12", "tracy/tracy": "^2.9", "phpstan/phpstan-nette": "^1" }, "conflict": { - "latte/latte": ">=3.1" + "latte/latte": ">=3.0.0 <3.0.12 || >=3.1" }, "suggest": { "ext-intl": "to use date/time controls" diff --git a/src/Bridges/FormsLatte/Nodes/FieldNNameNode.php b/src/Bridges/FormsLatte/Nodes/FieldNNameNode.php index cc2fa63d2..a3dbb858e 100644 --- a/src/Bridges/FormsLatte/Nodes/FieldNNameNode.php +++ b/src/Bridges/FormsLatte/Nodes/FieldNNameNode.php @@ -35,7 +35,7 @@ final class FieldNNameNode extends StatementNode public static function create(Tag $tag): \Generator { $tag->expectArguments(); - $node = new static; + $node = $tag->node = new static; $node->name = $tag->parser->parseUnquotedStringOrExpression(colon: false); if ($tag->parser->stream->tryConsume(':')) { $node->part = $tag->parser->isEnd() diff --git a/src/Bridges/FormsLatte/Nodes/FormContainerNode.php b/src/Bridges/FormsLatte/Nodes/FormContainerNode.php index 36cd2aa9f..f6bac29ab 100644 --- a/src/Bridges/FormsLatte/Nodes/FormContainerNode.php +++ b/src/Bridges/FormsLatte/Nodes/FormContainerNode.php @@ -31,7 +31,7 @@ public static function create(Tag $tag): \Generator $tag->outputMode = $tag::OutputRemoveIndentation; $tag->expectArguments(); - $node = new static; + $node = $tag->node = new static; $node->name = $tag->parser->parseUnquotedStringOrExpression(); [$node->content] = yield; return $node; diff --git a/src/Bridges/FormsLatte/Nodes/FormNNameNode.php b/src/Bridges/FormsLatte/Nodes/FormNNameNode.php index 75119298e..fe569b71d 100644 --- a/src/Bridges/FormsLatte/Nodes/FormNNameNode.php +++ b/src/Bridges/FormsLatte/Nodes/FormNNameNode.php @@ -31,7 +31,7 @@ final class FormNNameNode extends StatementNode public static function create(Tag $tag): \Generator { $tag->expectArguments(); - $node = new static; + $node = $tag->node = new static; $node->name = $tag->parser->parseUnquotedStringOrExpression(colon: false); [$node->content] = yield; $node->init($tag); diff --git a/src/Bridges/FormsLatte/Nodes/FormNode.php b/src/Bridges/FormsLatte/Nodes/FormNode.php index 2146a18a3..b4ee002e6 100644 --- a/src/Bridges/FormsLatte/Nodes/FormNode.php +++ b/src/Bridges/FormsLatte/Nodes/FormNode.php @@ -42,7 +42,7 @@ public static function create(Tag $tag): \Generator $tag->outputMode = $tag::OutputKeepIndentation; $tag->expectArguments(); - $node = new static; + $node = $tag->node = new static; $node->name = $tag->parser->parseUnquotedStringOrExpression(); $tag->parser->stream->tryConsume(','); $node->attributes = $tag->parser->parseArguments(); diff --git a/src/Bridges/FormsLatte/Nodes/LabelNode.php b/src/Bridges/FormsLatte/Nodes/LabelNode.php index cf1316c59..26d30d333 100644 --- a/src/Bridges/FormsLatte/Nodes/LabelNode.php +++ b/src/Bridges/FormsLatte/Nodes/LabelNode.php @@ -43,7 +43,7 @@ public static function create(Tag $tag): \Generator $tag->outputMode = $tag::OutputKeepIndentation; $tag->expectArguments(); - $node = new static; + $node = $tag->node = new static; $node->name = $tag->parser->parseUnquotedStringOrExpression(colon: false); if ($tag->parser->stream->tryConsume(':')) { $node->part = $tag->parser->isEnd() || $tag->parser->stream->is(',')