Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d08d5d1

Browse filesBrowse files
committed
remove remaining deprecation layers
1 parent 90b9ddf commit d08d5d1
Copy full SHA for d08d5d1

File tree

74 files changed

+55
-710
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

74 files changed

+55
-710
lines changed

‎src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ public function getDecoratedFactory()
8989
* @param callable|Cache\ChoiceFilter|null $filter The callable or static option for
9090
* filtering the choices
9191
*/
92-
public function createListFromChoices(iterable $choices, $value = null/*, $filter = null*/)
92+
public function createListFromChoices(iterable $choices, $value = null, $filter = null)
9393
{
94-
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
95-
9694
if ($choices instanceof \Traversable) {
9795
$choices = iterator_to_array($choices);
9896
}
@@ -134,10 +132,8 @@ public function createListFromChoices(iterable $choices, $value = null/*, $filte
134132
* @param callable|Cache\ChoiceFilter|null $filter The callable or static option for
135133
* filtering the choices
136134
*/
137-
public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null/*, $filter = null*/)
135+
public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null, $filter = null)
138136
{
139-
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
140-
141137
$cache = true;
142138

143139
if ($loader instanceof Cache\ChoiceLoader) {
@@ -181,9 +177,8 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
181177
* @param array|callable|Cache\ChoiceAttr|null $attr The option or static option generating the HTML attributes
182178
* @param array|callable|Cache\ChoiceTranslationParameters $labelTranslationParameters The parameters used to translate the choice labels
183179
*/
184-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
180+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null, $labelTranslationParameters = [])
185181
{
186-
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
187182
$cache = true;
188183

189184
if ($preferredChoices instanceof Cache\PreferredChoice) {

‎src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface ChoiceListFactoryInterface
3535
*
3636
* @return ChoiceListInterface The choice list
3737
*/
38-
public function createListFromChoices(iterable $choices, callable $value = null/*, callable $filter = null*/);
38+
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null);
3939

4040
/**
4141
* Creates a choice list that is loaded with the given loader.
@@ -48,7 +48,7 @@ public function createListFromChoices(iterable $choices, callable $value = null/
4848
*
4949
* @return ChoiceListInterface The choice list
5050
*/
51-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null/*, callable $filter = null*/);
51+
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null, callable $filter = null);
5252

5353
/**
5454
* Creates a view for the given choice list.
@@ -84,5 +84,5 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
8484
*
8585
* @return ChoiceListView The choice list view
8686
*/
87-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/);
87+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null, $labelTranslationParameters = []);
8888
}

‎src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ class DefaultChoiceListFactory implements ChoiceListFactoryInterface
3535
*
3636
* @param callable|null $filter
3737
*/
38-
public function createListFromChoices(iterable $choices, callable $value = null/*, callable $filter = null*/)
38+
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null)
3939
{
40-
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
41-
4240
if ($filter) {
4341
// filter the choice list lazily
4442
return $this->createListFromLoader(new FilterChoiceLoaderDecorator(
@@ -56,10 +54,8 @@ public function createListFromChoices(iterable $choices, callable $value = null/
5654
*
5755
* @param callable|null $filter
5856
*/
59-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null/*, callable $filter = null*/)
57+
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null, callable $filter = null)
6058
{
61-
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
62-
6359
if ($filter) {
6460
$loader = new FilterChoiceLoaderDecorator($loader, $filter);
6561
}
@@ -72,9 +68,8 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
7268
*
7369
* @param array|callable $labelTranslationParameters The parameters used to translate the choice labels
7470
*/
75-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
71+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null, $labelTranslationParameters = [])
7672
{
77-
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
7873
$preferredViews = [];
7974
$preferredViewsOrder = [];
8075
$otherViews = [];

‎src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ public function getDecoratedFactory()
6666
*
6767
* @return ChoiceListInterface The choice list
6868
*/
69-
public function createListFromChoices(iterable $choices, $value = null/*, $filter = null*/)
69+
public function createListFromChoices(iterable $choices, $value = null, $filter = null)
7070
{
71-
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
72-
7371
if (\is_string($value)) {
7472
$value = new PropertyPath($value);
7573
}
@@ -109,10 +107,8 @@ public function createListFromChoices(iterable $choices, $value = null/*, $filte
109107
*
110108
* @return ChoiceListInterface The choice list
111109
*/
112-
public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null/*, $filter = null*/)
110+
public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null, $filter = null)
113111
{
114-
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
115-
116112
if (\is_string($value)) {
117113
$value = new PropertyPath($value);
118114
}
@@ -154,9 +150,8 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
154150
*
155151
* @return ChoiceListView The choice list view
156152
*/
157-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
153+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null, $labelTranslationParameters = [])
158154
{
159-
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
160155
$accessor = $this->propertyAccessor;
161156

162157
if (\is_string($label)) {

‎src/Symfony/Component/Form/Extension/Core/DataMapper/RadioListMapper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataMapper/RadioListMapper.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ class RadioListMapper implements DataMapperInterface
3030
*/
3131
public function mapDataToForms($choice, \Traversable $radios)
3232
{
33-
if (\is_array($radios)) {
34-
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the second argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
35-
}
36-
3733
if (!\is_string($choice)) {
3834
throw new UnexpectedTypeException($choice, 'string');
3935
}

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ class PercentToLocalizedStringTransformer implements DataTransformerInterface
3939
/**
4040
* @see self::$types for a list of supported types
4141
*
42-
* @param int $scale The scale
43-
* @param string $type One of the supported types
44-
* @param int|null $roundingMode A value from \NumberFormatter, such as \NumberFormatter::ROUND_HALFUP
45-
* @param bool $html5Format Use an HTML5 specific format, see https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats
42+
* @param int $scale The scale
43+
* @param string $type One of the supported types
44+
* @param int $roundingMode A value from \NumberFormatter, such as \NumberFormatter::ROUND_HALFUP
45+
* @param bool $html5Format Use an HTML5 specific format, see https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats
4646
*
4747
* @throws UnexpectedTypeException if the given value of type is unknown
4848
*/
49-
public function __construct(int $scale = null, string $type = null, ?int $roundingMode = null, bool $html5Format = false)
49+
public function __construct(int $scale = null, string $type = null, int $roundingMode = \NumberFormatter::ROUND_HALFUP, bool $html5Format = false)
5050
{
5151
if (null === $scale) {
5252
$scale = 0;
@@ -56,10 +56,6 @@ public function __construct(int $scale = null, string $type = null, ?int $roundi
5656
$type = self::FRACTIONAL;
5757
}
5858

59-
if (null === $roundingMode && (\func_num_args() < 4 || func_get_arg(3))) {
60-
trigger_deprecation('symfony/form', '5.1', 'Not passing a rounding mode to "%s()" is deprecated. Starting with Symfony 6.0 it will default to "\NumberFormatter::ROUND_HALFUP".', __METHOD__);
61-
}
62-
6359
if (!\in_array($type, self::$types, true)) {
6460
throw new UnexpectedTypeException($type, implode('", "', self::$types));
6561
}

‎src/Symfony/Component/Form/Extension/Core/Type/BirthdayType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/BirthdayType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ public function configureOptions(OptionsResolver $resolver)
2424
{
2525
$resolver->setDefaults([
2626
'years' => range((int) date('Y') - 120, date('Y')),
27-
'invalid_message' => function (Options $options, $previousValue) {
28-
return ($options['legacy_error_messages'] ?? true)
29-
? $previousValue
30-
: 'Please enter a valid birthdate.';
31-
},
27+
'invalid_message' => 'Please enter a valid birthdate.',
3228
]);
3329

3430
$resolver->setAllowedTypes('years', 'array');

‎src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ public function configureOptions(OptionsResolver $resolver)
6161
'empty_data' => $emptyData,
6262
'compound' => false,
6363
'false_values' => [null],
64-
'invalid_message' => function (Options $options, $previousValue) {
65-
return ($options['legacy_error_messages'] ?? true)
66-
? $previousValue
67-
: 'The checkbox has an invalid value.';
68-
},
64+
'invalid_message' => 'The checkbox has an invalid value.',
6965
'is_empty_callback' => static function ($modelData): bool {
7066
return false === $modelData;
7167
},

‎src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
+2-24Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,13 @@ class ChoiceType extends AbstractType
5252
private $choiceListFactory;
5353
private $translator;
5454

55-
/**
56-
* @param TranslatorInterface $translator
57-
*/
58-
public function __construct(ChoiceListFactoryInterface $choiceListFactory = null, $translator = null)
55+
public function __construct(ChoiceListFactoryInterface $choiceListFactory = null, TranslatorInterface $translator = null)
5956
{
6057
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(
6158
new PropertyAccessDecorator(
6259
new DefaultChoiceListFactory()
6360
)
6461
);
65-
66-
// BC, to be removed in 6.0
67-
if ($this->choiceListFactory instanceof CachingFactoryDecorator) {
68-
return;
69-
}
70-
71-
$ref = new \ReflectionMethod($this->choiceListFactory, 'createListFromChoices');
72-
73-
if ($ref->getNumberOfParameters() < 3) {
74-
trigger_deprecation('symfony/form', '5.1', 'Not defining a third parameter "callable|null $filter" in "%s::%s()" is deprecated.', $ref->class, $ref->name);
75-
}
76-
77-
if (null !== $translator && !$translator instanceof TranslatorInterface) {
78-
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be han instance of "%s", "%s" given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
79-
}
8062
$this->translator = $translator;
8163
}
8264

@@ -390,11 +372,7 @@ public function configureOptions(OptionsResolver $resolver)
390372
'data_class' => null,
391373
'choice_translation_domain' => true,
392374
'trim' => false,
393-
'invalid_message' => function (Options $options, $previousValue) {
394-
return ($options['legacy_error_messages'] ?? true)
395-
? $previousValue
396-
: 'The selected choice is invalid.';
397-
},
375+
'invalid_message' => 'The selected choice is invalid.',
398376
]);
399377

400378
$resolver->setNormalizer('placeholder', $placeholderNormalizer);

‎src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,7 @@ public function configureOptions(OptionsResolver $resolver)
121121
'entry_type' => TextType::class,
122122
'entry_options' => [],
123123
'delete_empty' => false,
124-
'invalid_message' => function (Options $options, $previousValue) {
125-
return ($options['legacy_error_messages'] ?? true)
126-
? $previousValue
127-
: 'The collection is invalid.';
128-
},
124+
'invalid_message' => 'The collection is invalid.',
129125
]);
130126

131127
$resolver->setNormalizer('entry_options', $entryOptionsNormalizer);

‎src/Symfony/Component/Form/Extension/Core/Type/ColorType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/ColorType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ public function configureOptions(OptionsResolver $resolver)
7070
{
7171
$resolver->setDefaults([
7272
'html5' => false,
73-
'invalid_message' => function (Options $options, $previousValue) {
74-
return ($options['legacy_error_messages'] ?? true)
75-
? $previousValue
76-
: 'Please select a valid color.';
77-
},
73+
'invalid_message' => 'Please select a valid color.',
7874
]);
7975

8076
$resolver->setAllowedTypes('html5', 'bool');

‎src/Symfony/Component/Form/Extension/Core/Type/CountryType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/CountryType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ public function configureOptions(OptionsResolver $resolver)
4343
'choice_translation_domain' => false,
4444
'choice_translation_locale' => null,
4545
'alpha3' => false,
46-
'invalid_message' => function (Options $options, $previousValue) {
47-
return ($options['legacy_error_messages'] ?? true)
48-
? $previousValue
49-
: 'Please select a valid country.';
50-
},
46+
'invalid_message' => 'Please select a valid country.',
5147
]);
5248

5349
$resolver->setAllowedTypes('choice_translation_locale', ['null', 'string']);

‎src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ public function configureOptions(OptionsResolver $resolver)
4141
},
4242
'choice_translation_domain' => false,
4343
'choice_translation_locale' => null,
44-
'invalid_message' => function (Options $options, $previousValue) {
45-
return ($options['legacy_error_messages'] ?? true)
46-
? $previousValue
47-
: 'Please select a valid currency.';
48-
},
44+
'invalid_message' => 'Please select a valid currency.',
4945
]);
5046

5147
$resolver->setAllowedTypes('choice_translation_locale', ['null', 'string']);

‎src/Symfony/Component/Form/Extension/Core/Type/DateIntervalType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateIntervalType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,7 @@ public function configureOptions(OptionsResolver $resolver)
234234
'compound' => $compound,
235235
'empty_data' => $emptyData,
236236
'labels' => [],
237-
'invalid_message' => function (Options $options, $previousValue) {
238-
return ($options['legacy_error_messages'] ?? true)
239-
? $previousValue
240-
: 'Please choose a valid date interval.';
241-
},
237+
'invalid_message' => 'Please choose a valid date interval.',
242238
]);
243239
$resolver->setNormalizer('placeholder', $placeholderNormalizer);
244240
$resolver->setNormalizer('labels', $labelsNormalizer);

‎src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,7 @@ public function configureOptions(OptionsResolver $resolver)
273273
return $options['compound'] ? [] : '';
274274
},
275275
'input_format' => 'Y-m-d H:i:s',
276-
'invalid_message' => function (Options $options, $previousValue) {
277-
return ($options['legacy_error_messages'] ?? true)
278-
? $previousValue
279-
: 'Please enter a valid date and time.';
280-
},
276+
'invalid_message' => 'Please enter a valid date and time.',
281277
]);
282278

283279
// Don't add some defaults in order to preserve the defaults

‎src/Symfony/Component/Form/Extension/Core/Type/DateType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,7 @@ public function configureOptions(OptionsResolver $resolver)
299299
},
300300
'choice_translation_domain' => false,
301301
'input_format' => 'Y-m-d',
302-
'invalid_message' => function (Options $options, $previousValue) {
303-
return ($options['legacy_error_messages'] ?? true)
304-
? $previousValue
305-
: 'Please enter a valid date.';
306-
},
302+
'invalid_message' => 'Please enter a valid date.',
307303
]);
308304

309305
$resolver->setNormalizer('placeholder', $placeholderNormalizer);

‎src/Symfony/Component/Form/Extension/Core/Type/EmailType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/EmailType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ class EmailType extends AbstractType
2323
public function configureOptions(OptionsResolver $resolver)
2424
{
2525
$resolver->setDefaults([
26-
'invalid_message' => function (Options $options, $previousValue) {
27-
return ($options['legacy_error_messages'] ?? true)
28-
? $previousValue
29-
: 'Please enter a valid email address.';
30-
},
26+
'invalid_message' => 'Please enter a valid email address.',
3127
]);
3228
}
3329

‎src/Symfony/Component/Form/Extension/Core/Type/FileType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/FileType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,7 @@ public function configureOptions(OptionsResolver $resolver)
130130
'empty_data' => $emptyData,
131131
'multiple' => false,
132132
'allow_file_upload' => true,
133-
'invalid_message' => function (Options $options, $previousValue) {
134-
return ($options['legacy_error_messages'] ?? true)
135-
? $previousValue
136-
: 'Please select a valid file.';
137-
},
133+
'invalid_message' => 'Please select a valid file.',
138134
]);
139135
}
140136

‎src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ public function configureOptions(OptionsResolver $resolver)
2828
// Pass errors to the parent
2929
'error_bubbling' => true,
3030
'compound' => false,
31-
'invalid_message' => function (Options $options, $previousValue) {
32-
return ($options['legacy_error_messages'] ?? true)
33-
? $previousValue
34-
: 'The hidden field is invalid.';
35-
},
31+
'invalid_message' => 'The hidden field is invalid.',
3632
]);
3733
}
3834

‎src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ public function configureOptions(OptionsResolver $resolver)
4949
// Integer cast rounds towards 0, so do the same when displaying fractions
5050
'rounding_mode' => \NumberFormatter::ROUND_DOWN,
5151
'compound' => false,
52-
'invalid_message' => function (Options $options, $previousValue) {
53-
return ($options['legacy_error_messages'] ?? true)
54-
? $previousValue
55-
: 'Please enter an integer.';
56-
},
52+
'invalid_message' => 'Please enter an integer.',
5753
]);
5854

5955
$resolver->setAllowedValues('rounding_mode', [

‎src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ public function configureOptions(OptionsResolver $resolver)
5858
'choice_translation_locale' => null,
5959
'alpha3' => false,
6060
'choice_self_translation' => false,
61-
'invalid_message' => function (Options $options, $previousValue) {
62-
return ($options['legacy_error_messages'] ?? true)
63-
? $previousValue
64-
: 'Please select a valid language.';
65-
},
61+
'invalid_message' => 'Please select a valid language.',
6662
]);
6763

6864
$resolver->setAllowedTypes('choice_self_translation', ['bool']);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.