Skip to content

Commit bf0f15f

Browse files
committed
TASK: Reduce mental thinking complexity for $attributeTranspiler ??= new AttributeTranspiler(
- just stumbled on this, and we dont lazily instantiate objects in other places, so we might as well dont do it here ^^
1 parent 9cd7a0d commit bf0f15f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Target/Php/Transpiler/Tag/TagTranspiler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public function transpile(TagNode $tagNode): string
3939
{
4040
$result = sprintf('<%s', $tagNode->tagName);
4141

42-
$attributeTranspiler = null;
42+
$attributeTranspiler = new AttributeTranspiler(
43+
scope: $this->scope
44+
);
45+
4346
foreach ($tagNode->attributes->items as $attribute) {
44-
$attributeTranspiler ??= new AttributeTranspiler(
45-
scope: $this->scope
46-
);
4747
$result .= ' ' . $attributeTranspiler->transpile($attribute);
4848
}
4949

0 commit comments

Comments
 (0)