minor #34212 [Form] fix exception messages (xabbuh)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[Form] fix exception messages

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

be8cb4e fix exception messages
This commit is contained in:
Yonel Ceruto 2019-11-06 12:58:36 -05:00
commit bf27a83064
2 changed files with 2 additions and 2 deletions

View File

@ -320,7 +320,7 @@ class DateTimeType extends AbstractType
});
$resolver->setNormalizer('html5', function (Options $options, $html5) {
if ($html5 && self::HTML5_FORMAT !== $options['format']) {
throw new LogicException(sprintf('Cannot use the "format" option of %s when the "html5" option is disabled.', self::class));
throw new LogicException(sprintf('Cannot use the "format" option of %s when the "html5" option is enabled.', self::class));
}
return $html5;

View File

@ -311,7 +311,7 @@ class DateType extends AbstractType
$resolver->setNormalizer('html5', function (Options $options, $html5) {
if ($html5 && 'single_text' === $options['widget'] && self::HTML5_FORMAT !== $options['format']) {
throw new LogicException(sprintf('Cannot use the "format" option of %s when the "html5" option is disabled.', self::class));
throw new LogicException(sprintf('Cannot use the "format" option of %s when the "html5" option is enabled.', self::class));
}
return $html5;