Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"nette/di": "<3.2",
"nette/forms": "<3.2",
"nette/schema": "<1.3",
"latte/latte": "<3.1.5 || >=3.2",
"latte/latte": "<3.1.4 || >=3.2",
"tracy/tracy": "<2.12"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/Bridges/ApplicationLatte/Nodes/ControlNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


/**
* {control name[:method] [, params]}
* {control name[:method] [,] [params]}
* Renders a component by calling its render() method.
*/
class ControlNode extends StatementNode
Expand All @@ -39,7 +39,7 @@ public static function create(Tag $tag): static
$node->method = $tag->parser->parseExpression();
}

$tag->parser->consumeCommaBeforeArguments(strict: false);
$stream->tryConsume(',');
$start = $stream->getIndex();
$node->args = $tag->parser->parseArguments();
$start -= $stream->getIndex();
Expand Down
10 changes: 5 additions & 5 deletions tests/Bridges.Latte/{control}.2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ $latte->renderToString('

{control $name:$name}

{control form, var1}
{control form var1}

{control form, var1, 1, 2}
{control form var1, 1, 2}

{control form, wrap => 5, 1, 2}
{control form wrap => 5, 1, 2}

{control form, [var1 => 5], 1, 2}
{control form [var1 => 5], 1, 2}

{control form, 5, 1, var1: 2}
{control form 5, 1, var1: 2}
', $params);

Assert::same([
Expand Down
53 changes: 0 additions & 53 deletions tests/Bridges.Latte/{control}.commaWarning.phpt

This file was deleted.

6 changes: 3 additions & 3 deletions tests/Bridges.Latte/{control}.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Assert::match(
$ʟ_tmp->renderType('param') /* pos 1:1 */;
%A%
XX,
$latte->compile('{control form:type, param}'),
$latte->compile('{control form:type param}'),
);

Assert::match(
Expand All @@ -69,7 +69,7 @@ Assert::match(
$ʟ_tmp->render(...$params) /* pos 1:1 */;
%A%
XX,
$latte->compile('{control form, (expand) $params}'),
$latte->compile('{control form (expand) $params}'),
);

Assert::match(
Expand All @@ -78,7 +78,7 @@ Assert::match(
$ʟ_tmp->renderType(['param' => 123]) /* pos 1:1 */;
%A%
XX,
$latte->compile('{control form:type, param => 123}'),
$latte->compile('{control form:type param => 123}'),
);

Assert::match(
Expand Down