Skip to content

Commit bf5959f

Browse files
committed
[Fix] Revert throwing exception when public property is unitialized
Fix #1909
1 parent 7a84975 commit bf5959f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/TwigComponent/src/ComponentRenderer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ private function preRender(MountedComponent $mounted, array $context = []): PreR
142142
private function exposedVariables(object $component, bool $exposePublicProps): \Iterator
143143
{
144144
if ($exposePublicProps) {
145-
$publicProps = get_object_vars($component);
146-
if ($uninitializedProps = array_diff_key(get_class_vars($component::class), $publicProps)) {
147-
throw new \LogicException(sprintf('Cannot expose uninitialized property "$%s" from "%s".', array_keys($uninitializedProps)[0], $component::class));
148-
}
149-
yield from $publicProps;
145+
yield from get_object_vars($component);
150146
}
151147

152148
$class = new \ReflectionClass($component);

0 commit comments

Comments
 (0)