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:
commit
bf27a83064
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user