Skip to content

Commit

Permalink
improved Latte 3 nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
dg authored and f3l1x committed Dec 3, 2022
1 parent 5bafb56 commit 80e15b6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/Latte/Extension/Node/MultiplierAddNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ final class MultiplierAddNode extends StatementNode
{

/** @var ExpressionNode */
private $name;
public $name;

/** @var ArrayNode */
private $attributes;
public $attributes;

/** @var ExpressionNode */
private $part;
public $part;

public static function create(Tag $tag): self
{
Expand Down Expand Up @@ -74,4 +74,10 @@ public static function getCreateButton(Multiplier $multiplier, $buttonId): ?Subm
return $multiplier->getCreateButtons()[$buttonId] ?? null;
}

public function &getIterator(): \Generator
{
yield $this->name;
yield $this->attributes;
yield $this->part;
}
}
4 changes: 2 additions & 2 deletions src/Latte/Extension/Node/MultiplierNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ final class MultiplierNode extends StatementNode
{

/** @var ExpressionNode */
private $name;
public $name;

/** @var AreaNode */
private $content;
public $content;

/**
* @return Generator<int, ?mixed[], array{AreaNode, ?Tag}, self>
Expand Down
7 changes: 6 additions & 1 deletion src/Latte/Extension/Node/MultiplierRemoveNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class MultiplierRemoveNode extends StatementNode
{

/** @var ArrayNode */
private $attributes;
public $attributes;

public static function create(Tag $tag): self
{
Expand Down Expand Up @@ -54,4 +54,9 @@ public static function getRemoveButton(array $formsStack): ?IComponent
return $container->getComponent(Multiplier::SUBMIT_REMOVE_NAME, false);
}

public function &getIterator(): \Generator
{
yield $this->attributes;
}

}

0 comments on commit 80e15b6

Please sign in to comment.