@@ -144,27 +144,28 @@ private function getFormConfiguration(
144144 },
145145 'choice_value ' => 'code ' ,
146146 ];
147- } else {
148- $ constraint = ConstraintCreator::createFromConfiguration (
149- $ customerOptionType ,
150- $ customerOption ->getConfiguration ()
151- );
147+ }
152148
153- if ( $ constraint !== null ) {
154- $ constraint -> groups = [ ' sylius ' ];
155- $ configuration = [ ' constraints ' => [ $ constraint ]];
156- }
149+ $ constraint = ConstraintCreator:: createFromConfiguration (
150+ $ customerOptionType ,
151+ $ customerOption -> getConfiguration ()
152+ );
157153
158- if ($ customerOption -> isRequired () ) {
159- /** @var NotBlank $requiredConstraint */
160- $ requiredConstraint = ConstraintCreator:: createRequiredConstraint () ;
161- $ requiredConstraint -> message = ' brille24.form.customer_options.required ' ;
154+ if ($ constraint !== null ) {
155+ $ constraint -> groups = [ ' sylius ' ];
156+ $ configuration = [ ' constraints ' => [ $ constraint ]] ;
157+ }
162158
163- $ requiredConstraint ->groups = ['sylius ' ];
164- $ configuration ['constraints ' ][] = $ requiredConstraint ;
165- }
159+ if ($ customerOption ->isRequired ()) {
160+ /** @var NotBlank $requiredConstraint */
161+ $ requiredConstraint = ConstraintCreator::createRequiredConstraint ();
162+ $ requiredConstraint ->message = 'brille24.form.customer_options.required ' ;
163+
164+ $ requiredConstraint ->groups = ['sylius ' ];
165+ $ configuration ['constraints ' ][] = $ requiredConstraint ;
166166 }
167167
168+
168169 if ($ customerOptionType === CustomerOptionTypeEnum::FILE ) {
169170 /*
170171 * Here we give the Customer Option File Type a special block name to override it in a form theme.
0 commit comments