Skip to content

Commit 0447b4c

Browse files
author
Hugo Hamon
committed
Adds deprecation notices for structures to be removed in 3.0.
1 parent efb0d81 commit 0447b4c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

OptionsResolver.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ public function count()
10151015
*/
10161016
public function set($option, $value)
10171017
{
1018+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setDefaults() method instead.', E_USER_DEPRECATED);
1019+
10181020
return $this->setDefault($option, $value);
10191021
}
10201022

@@ -1025,6 +1027,8 @@ public function set($option, $value)
10251027
*/
10261028
public function replace(array $defaults)
10271029
{
1030+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the clear() and setDefaults() methods instead.', E_USER_DEPRECATED);
1031+
10281032
$this->clear();
10291033

10301034
return $this->setDefaults($defaults);
@@ -1037,6 +1041,8 @@ public function replace(array $defaults)
10371041
*/
10381042
public function overload($option, $value)
10391043
{
1044+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setDefault() method instead.', E_USER_DEPRECATED);
1045+
10401046
return $this->setDefault($option, $value);
10411047
}
10421048

@@ -1047,6 +1053,8 @@ public function overload($option, $value)
10471053
*/
10481054
public function get($option)
10491055
{
1056+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the ArrayAccess syntax instead to get an option value.', E_USER_DEPRECATED);
1057+
10501058
return $this->offsetGet($option);
10511059
}
10521060

@@ -1057,6 +1065,8 @@ public function get($option)
10571065
*/
10581066
public function has($option)
10591067
{
1068+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the ArrayAccess syntax instead to get an option value.', E_USER_DEPRECATED);
1069+
10601070
return $this->offsetExists($option);
10611071
}
10621072

@@ -1067,6 +1077,8 @@ public function has($option)
10671077
*/
10681078
public function replaceDefaults(array $defaultValues)
10691079
{
1080+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the clear() and setDefaults() methods instead.', E_USER_DEPRECATED);
1081+
10701082
$this->clear();
10711083

10721084
return $this->setDefaults($defaultValues);
@@ -1079,6 +1091,8 @@ public function replaceDefaults(array $defaultValues)
10791091
*/
10801092
public function setOptional(array $optionNames)
10811093
{
1094+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setDefined() method instead.', E_USER_DEPRECATED);
1095+
10821096
return $this->setDefined($optionNames);
10831097
}
10841098

@@ -1089,6 +1103,8 @@ public function setOptional(array $optionNames)
10891103
*/
10901104
public function isKnown($option)
10911105
{
1106+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the isDefined() method instead.', E_USER_DEPRECATED);
1107+
10921108
return $this->isDefined($option);
10931109
}
10941110

OptionsResolverInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\OptionsResolver;
1313

14-
trigger_error('The "Symfony\Component\OptionsResolver\OptionsResolverInterface" interface was deprecated in version 2.6 and will be removed in 3.0. Use "Symfony\Component\OptionsResolver\OptionsResolver" instead.', E_USER_DEPRECATED);
14+
trigger_error('The '.__NAMESPACE__.'\OptionsResolverInterface interface is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\OptionsResolver\OptionsResolver class instead.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
1717
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
@@ -22,6 +22,7 @@
2222
*
2323
* @deprecated since version 2.6, to be removed in Symfony 3.0.
2424
* Use {@link OptionsResolver} instead.
25+
* @deprecated since version 2.6, to be removed in 3.0. Use {@link OptionsResolver} instead.
2526
*/
2627
interface OptionsResolverInterface
2728
{

0 commit comments

Comments
 (0)