File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1919 */
2020trait 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}
You can’t perform that action at this time.
0 commit comments