3030use Symfony \Component \OptionsResolver \OptionsResolver ;
3131
3232/**
33- * Boolean form field type.
34- *
3533 * @author Raymond Schouten
3634 *
3735 * @since 2.3
3836 */
3937class BooleanType extends AbstractType
4038{
41- /**
42- * Builds the form.
43- */
4439 public function buildForm (FormBuilderInterface $ builder , array $ options ): void
4540 {
4641 if (!class_exists (BooleanToValueTransformer::class)) {
@@ -50,9 +45,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
5045 $ builder ->addModelTransformer (new BooleanToValueTransformer ($ options ['value_true ' ], $ options ['value_false ' ]));
5146 }
5247
53- /**
54- * Configures the options for this type.
55- */
5648 public function configureOptions (OptionsResolver $ resolver ): void
5749 {
5850 $ labelTrueNormalizer = fn (Options $ options , $ value ) =>
@@ -92,9 +84,6 @@ public function configureOptions(OptionsResolver $resolver): void
9284 $ resolver ->setAllowedValues ('widget ' , ['choice ' , 'radio ' ]);
9385 }
9486
95- /**
96- * Returns the name of the parent type.
97- */
9887 public function getParent (): string
9988 {
10089 return ChoiceType::class;
@@ -105,6 +94,6 @@ public function getParent(): string
10594 */
10695 public function humanize (string $ text ): string
10796 {
108- return ucfirst (trim (strtolower (preg_replace (['/([A-Z])/ ' , '/[_\s]+/ ' ], ['_$1 ' , ' ' ], $ text ))));
97+ return ucfirst (trim (strtolower (( string ) preg_replace (['/([A-Z])/ ' , '/[_\s]+/ ' ], ['_$1 ' , ' ' ], $ text ))));
10998 }
11099}
0 commit comments