Skip to content

Commit a4547ec

Browse files
committed
revert force
1 parent ec813b9 commit a4547ec

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/lib/Twig/Components/ListFieldTrait.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,21 @@
1919
*/
2020
trait ListFieldTrait
2121
{
22-
public string $direction = 'vertical';
22+
private const string VERTICAL = 'vertical';
23+
private const string HORIZONTAL = 'horizontal';
24+
25+
public string $direction = self::VERTICAL;
2326

2427
/** @var ListItem[] */
2528
#[ExposeInTemplate(name: 'items', getter: 'getItems')]
2629
public array $items = [];
2730

28-
/** @return ListItem[] */
31+
/**
32+
* @return ListItems
33+
*/
2934
public function getItems(): array
3035
{
31-
return array_map(function ($item) {
36+
return array_map(function (array $item) {
3237
$listItem = $item + ['name' => $this->name, 'required' => $this->required];
3338

3439
return $this->modifyListItem($listItem);
@@ -49,7 +54,7 @@ protected function validateListFieldProps(OptionsResolver $resolver): void
4954

5055
$resolver
5156
->define('direction')
52-
->allowedValues('vertical', 'horizontal')
53-
->default('vertical');
57+
->allowedValues(self::VERTICAL, self::HORIZONTAL)
58+
->default(self::VERTICAL);
5459
}
5560
}

0 commit comments

Comments
 (0)