Skip to content

Commit 78cba96

Browse files
mikadamczykGrabowskiM
authored andcommitted
Fixed CI
1 parent 2bd2c3e commit 78cba96

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib/Twig/Components/OverflowList.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,19 @@ public function validate(array $props): array
5454
#[ExposeInTemplate('item_template_props')]
5555
public function getItemTemplateProps(): array
5656
{
57+
$itemPropsNames = array_keys($this->items[0]);
58+
5759
$itemPropsPatterns = array_map(
58-
fn (string $name): string => '{{ ' . $name . ' }}',
60+
static fn (string $name): string => '{{ ' . $name . ' }}',
5961
$this->itemTemplateProps
6062
);
6163

62-
return array_combine($this->itemTemplateProps, $itemPropsPatterns);
64+
$props = array_combine($itemPropsNames, $itemPropsPatterns);
65+
66+
if (empty($props)) {
67+
return [];
68+
}
69+
70+
return $props;
6371
}
6472
}

0 commit comments

Comments
 (0)