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
Copy file name to clipboardExpand all lines: OptionsResolver.php
+30-7Lines changed: 30 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -424,10 +424,23 @@ public function setNormalizer($option, \Closure $normalizer)
424
424
}
425
425
426
426
/**
427
-
* {@inheritdoc}
427
+
* Sets the normalizers for an array of options.
428
+
*
429
+
* @param array $normalizers An array of closures
430
+
*
431
+
* @return OptionsResolver This instance
432
+
*
433
+
* @throws UndefinedOptionsException If the option is undefined
434
+
* @throws AccessException If called from a lazy option or normalizer
435
+
*
436
+
* @see setNormalizer()
437
+
*
438
+
* @deprecated since version 2.6, to be removed in 3.0.
428
439
*/
429
440
publicfunctionsetNormalizers(array$normalizers)
430
441
{
442
+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use setNormalizer() instead.', E_USER_DEPRECATED);
443
+
431
444
foreach ($normalizersas$option => $normalizer) {
432
445
$this->setNormalizer($option, $normalizer);
433
446
}
@@ -464,6 +477,8 @@ public function setAllowedValues($option, $allowedValues = null)
464
477
465
478
// BC
466
479
if (is_array($option) && null === $allowedValues) {
480
+
trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
@@ -518,6 +533,8 @@ public function addAllowedValues($option, $allowedValues = null)
518
533
519
534
// BC
520
535
if (is_array($option) && null === $allowedValues) {
536
+
trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
@@ -570,6 +589,8 @@ public function setAllowedTypes($option, $allowedTypes = null)
570
589
571
590
// BC
572
591
if (is_array($option) && null === $allowedTypes) {
592
+
trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
@@ -618,6 +639,8 @@ public function addAllowedTypes($option, $allowedTypes = null)
618
639
619
640
// BC
620
641
if (is_array($option) && null === $allowedTypes) {
642
+
trigger_error('Calling the '.__METHOD__.' method with an array of options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
0 commit comments