File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/Symfony/Component/Form/Extension/Validator Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,13 @@ public function guessTypeForConstraint(Constraint $constraint)
171171
172172 case 'Symfony\Component\Validator\Constraints\Url ' :
173173 return new TypeGuess ('url ' , array (), Guess::HIGH_CONFIDENCE );
174+
175+ case 'Symfony\Component\Validator\Constraints\True ' :
176+ case 'Symfony\Component\Validator\Constraints\False ' :
177+ return new TypeGuess ('checkbox ' , array (), Guess::MEDIUM_CONFIDENCE );
174178 }
179+
180+ return null ;
175181 }
176182
177183 /**
@@ -186,8 +192,11 @@ public function guessRequiredForConstraint(Constraint $constraint)
186192 switch (get_class ($ constraint )) {
187193 case 'Symfony\Component\Validator\Constraints\NotNull ' :
188194 case 'Symfony\Component\Validator\Constraints\NotBlank ' :
195+ case 'Symfony\Component\Validator\Constraints\True ' :
189196 return new ValueGuess (true , Guess::HIGH_CONFIDENCE );
190197 }
198+
199+ return null ;
191200 }
192201
193202 /**
@@ -215,6 +224,8 @@ public function guessMaxLengthForConstraint(Constraint $constraint)
215224 case 'Symfony\Component\Validator\Constraints\Size ' :
216225 return new ValueGuess (strlen ((string ) $ constraint ->max ), Guess::LOW_CONFIDENCE );
217226 }
227+
228+ return null ;
218229 }
219230
220231 /**
@@ -250,6 +261,8 @@ public function guessPatternForConstraint(Constraint $constraint)
250261 }
251262 break ;
252263 }
264+
265+ return null ;
253266 }
254267
255268 /**
You can’t perform that action at this time.
0 commit comments