You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #28721 [Form] deprecate some options for single_text widgets (xabbuh)
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] deprecate some options for single_text widgets
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
89ff331865 deprecate some options for single_text widgets
@@ -292,6 +292,31 @@ public function configureOptions(OptionsResolver $resolver)
292
292
'text',
293
293
'choice',
294
294
]);
295
+
296
+
$resolver->setDeprecated('date_format', function (Options$options, $dateFormat) {
297
+
if (null !== $dateFormat && 'single_text' === $options['widget']) {
298
+
returnsprintf('Using the "date_format" option of %s when the "widget" option is set to "single_text" is deprecated since Symfony 4.3 and will lead to an exception in 5.0.', self::class);
299
+
//throw new LogicException(sprintf('Cannot use the "date_format" option of the %s when the "widget" option is set to "single_text".', self::class));
300
+
}
301
+
302
+
return'';
303
+
});
304
+
$resolver->setDeprecated('date_widget', function (Options$options, $dateWidget) {
305
+
if (null !== $dateWidget && 'single_text' === $options['widget']) {
306
+
returnsprintf('Using the "date_widget" option of %s when the "widget" option is set to "single_text" is deprecated since Symfony 4.3 and will lead to an exception in 5.0.', self::class);
307
+
//throw new LogicException(sprintf('Cannot use the "date_widget" option of the %s when the "widget" option is set to "single_text".', self::class));
308
+
}
309
+
310
+
return'';
311
+
});
312
+
$resolver->setDeprecated('time_widget', function (Options$options, $timeWidget) {
313
+
if (null !== $timeWidget && 'single_text' === $options['widget']) {
314
+
returnsprintf('Using the "time_widget" option of %s when the "widget" option is set to "single_text" is deprecated since Symfony 4.3 and will lead to an exception in 5.0.', self::class);
315
+
//throw new LogicException(sprintf('Cannot use the "time_widget" option of the %s when the "widget" option is set to "single_text".', self::class));
0 commit comments