[OptionsResolver] add missing deprecation triggers

This commit is contained in:
Tobias Schultze 2015-02-27 17:11:51 +01:00
parent 469e70d5be
commit 7e9d2e618b

View File

@ -428,6 +428,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
*/
public function setNormalizers(array $normalizers)
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use setNormalizer() instead.', E_USER_DEPRECATED);
foreach ($normalizers as $option => $normalizer) {
$this->setNormalizer($option, $normalizer);
}
@ -464,6 +466,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
// BC
if (is_array($option) && null === $allowedValues) {
trigger_error('Calling the '.__METHOD__.' method with an array 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);
foreach ($option as $optionName => $optionValues) {
$this->setAllowedValues($optionName, $optionValues);
}
@ -518,6 +522,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
// BC
if (is_array($option) && null === $allowedValues) {
trigger_error('Calling the '.__METHOD__.' method with an array 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);
foreach ($option as $optionName => $optionValues) {
$this->addAllowedValues($optionName, $optionValues);
}
@ -570,6 +576,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
// BC
if (is_array($option) && null === $allowedTypes) {
trigger_error('Calling the '.__METHOD__.' method with an array 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);
foreach ($option as $optionName => $optionTypes) {
$this->setAllowedTypes($optionName, $optionTypes);
}
@ -618,6 +626,8 @@ class OptionsResolver implements Options, OptionsResolverInterface
// BC
if (is_array($option) && null === $allowedTypes) {
trigger_error('Calling the '.__METHOD__.' method with an array 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);
foreach ($option as $optionName => $optionTypes) {
$this->addAllowedTypes($optionName, $optionTypes);
}