Skip to content

Commit

Permalink
[Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/T…
Browse files Browse the repository at this point in the history
…imeFields

Field type guessing breaks, if you use any of the Date/Time
constraints, since these field types have no 'type' default option
defined.
  • Loading branch information
TonyMalz committed May 18, 2012
1 parent 68eca0f commit 41bed29
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ public function guessTypeForConstraint(Constraint $constraint)
case 'Symfony\Component\Validator\Constraints\Date':
return new TypeGuess(
'date',
array('type' => 'string'),
array(),
Guess::HIGH_CONFIDENCE
);
case 'Symfony\Component\Validator\Constraints\DateTime':
return new TypeGuess(
'datetime',
array('type' => 'string'),
array(),
Guess::HIGH_CONFIDENCE
);
case 'Symfony\Component\Validator\Constraints\Email':
Expand Down Expand Up @@ -212,7 +212,7 @@ public function guessTypeForConstraint(Constraint $constraint)
case 'Symfony\Component\Validator\Constraints\Time':
return new TypeGuess(
'time',
array('type' => 'string'),
array(),
Guess::HIGH_CONFIDENCE
);
case 'Symfony\Component\Validator\Constraints\Url':
Expand Down

0 comments on commit 41bed29

Please sign in to comment.