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 2020 */
2121trait ListFieldTrait
2222{
23- public string $ direction = 'vertical ' ;
23+ private const string VERTICAL = 'vertical ' ;
24+ private const string HORIZONTAL = 'horizontal ' ;
25+
26+ public string $ direction = self ::VERTICAL ;
2427
2528 /** @var ListItems */
2629 #[ExposeInTemplate(name: 'items ' , getter: 'getItems ' )]
2730 public array $ items = [];
2831
29- /** @return ListItems */
32+ /**
33+ * @return ListItems
34+ */
3035 public function getItems (): array
3136 {
32- return array_map (function ($ item ) {
37+ return array_map (function (array $ item ) {
3338 $ listItem = $ item + ['name ' => $ this ->name , 'required ' => $ this ->required ];
3439
3540 return $ this ->modifyListItem ($ listItem );
@@ -55,7 +60,7 @@ protected function validateListFieldProps(OptionsResolver $resolver): void
5560
5661 $ resolver
5762 ->define ('direction ' )
58- ->allowedValues (' vertical ' , ' horizontal ' )
59- ->default (' vertical ' );
63+ ->allowedValues (self :: VERTICAL , self :: HORIZONTAL )
64+ ->default (self :: VERTICAL );
6065 }
6166}
You can’t perform that action at this time.
0 commit comments