Skip to content

Commit b19c71a

Browse files
author
matheo
committed
destruct properties
1 parent 82d9a9f commit b19c71a

File tree

8 files changed

+98
-1
lines changed

8 files changed

+98
-1
lines changed

src/TwigComponent/doc/.idea/.gitignore

Whitespace-only changes.

src/TwigComponent/doc/.idea/doc.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TwigComponent/doc/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TwigComponent/doc/.idea/php.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TwigComponent/doc/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TwigComponent/doc/.idea/workspace.xml

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TwigComponent/src/ComponentRenderer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ private function exposedVariables(object $component, bool $exposePublicProps): \
131131
/** @var ExposeInTemplate $attribute */
132132
$value = $attribute->getter ? $component->{rtrim($attribute->getter, '()')}() : $this->propertyAccessor->getValue($component, $property->name);
133133

134+
if ($attribute->destruct) {
135+
foreach ($value as $key => $destructedValue) {
136+
yield $key => $destructedValue;
137+
}
138+
}
139+
134140
yield $attribute->name ?? $property->name => $value;
135141
}
136142

src/TwigComponent/src/DependencyInjection/TwigComponentExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Symfony\UX\TwigComponent\ComponentRendererInterface;
2424
use Symfony\UX\TwigComponent\ComponentStack;
2525
use Symfony\UX\TwigComponent\ComponentTemplateFinder;
26-
use Symfony\UX\TwigComponent\ComponentTemplateFinderInterface;
2726
use Symfony\UX\TwigComponent\DependencyInjection\Compiler\TwigComponentPass;
2827
use Symfony\UX\TwigComponent\Twig\ComponentExtension;
2928
use Symfony\UX\TwigComponent\Twig\ComponentLexer;

0 commit comments

Comments
 (0)