Skip to content

Commit 83e654c

Browse files
committed
wip
1 parent d58bf77 commit 83e654c

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

packages/view/src/Elements/ViewComponentElement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function compile(): string
137137

138138
$compiled = $compiled
139139
->prepend(
140-
// Add attributes to the current scope
140+
// Add attributes to the current scope
141141
'<?php $_previousAttributes = $attributes ?? null; ?>',
142142
sprintf('<?php $attributes = \Tempest\Support\arr(%s); ?>', var_export($this->dataAttributes, true)), // @mago-expect best-practices/no-debug-symbols Set the new value of $attributes for this view component
143143

@@ -146,7 +146,7 @@ public function compile(): string
146146
sprintf('<?php $slots = \Tempest\Support\arr(%s); ?>', var_export($slots, true)), // @mago-expect best-practices/no-debug-symbols Set the new value of $slots for this view component
147147
)
148148
->append(
149-
// Restore previous slots
149+
// Restore previous slots
150150
'<?php unset($slots); ?>',
151151
'<?php $slots = $_previousSlots ?? null; ?>',
152152
'<?php unset($_previousSlots); ?>',
@@ -188,4 +188,4 @@ public function compile(): string
188188

189189
return $this->compiler->compile($compiled->toString());
190190
}
191-
}
191+
}

tests/Integration/View/ViewComponentTest.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -906,24 +906,30 @@ public function test_default_slot_value(): void
906906
<x-slot name="b">Default B</x-slot>
907907
HTML);
908908

909-
$this->assertSnippetsMatch(<<<'HTML'
910-
Overwritten
911-
Overwritten A
912-
Overwritten B
913-
HTML, $this->render('<x-test>
909+
$this->assertSnippetsMatch(
910+
<<<'HTML'
911+
Overwritten
912+
Overwritten A
913+
Overwritten B
914+
HTML,
915+
$this->render('<x-test>
914916
Overwritten
915917
<x-slot name="a">Overwritten A</x-slot>
916918
<x-slot name="b">Overwritten B</x-slot>
917-
</x-test>'));
919+
</x-test>'),
920+
);
918921

919-
$this->assertSnippetsMatch(<<<'HTML'
920-
Overwritten
921-
Default A
922-
Overwritten B
923-
HTML, $this->render('<x-test>
922+
$this->assertSnippetsMatch(
923+
<<<'HTML'
924+
Overwritten
925+
Default A
926+
Overwritten B
927+
HTML,
928+
$this->render('<x-test>
924929
Overwritten
925930
<x-slot name="b">Overwritten B</x-slot>
926-
</x-test>'));
931+
</x-test>'),
932+
);
927933

928934
$this->assertSnippetsMatch(<<<'HTML'
929935
Default

0 commit comments

Comments
 (0)