|
40 | 40 | */
|
41 | 41 | class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
|
42 | 42 | {
|
| 43 | + /** |
| 44 | + * @deprecated since version 3.3, to be removed in 4.0 alongside with magic methods below |
| 45 | + */ |
43 | 46 | protected $container;
|
| 47 | + |
| 48 | + /** |
| 49 | + * @deprecated since version 3.3, to be removed in 4.0 alongside with magic methods below |
| 50 | + */ |
44 | 51 | protected $validators;
|
45 | 52 |
|
46 | 53 | /**
|
@@ -85,4 +92,52 @@ public function getInstance(Constraint $constraint)
|
85 | 92 |
|
86 | 93 | return $this->validators[$name];
|
87 | 94 | }
|
| 95 | + |
| 96 | + /** |
| 97 | + * @internal |
| 98 | + */ |
| 99 | + public function __get($name) |
| 100 | + { |
| 101 | + if ('validators' === $name || 'container' === $name) { |
| 102 | + @trigger_error(sprintf('Using the "%s::$%s" property is deprecated since version 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED); |
| 103 | + } |
| 104 | + |
| 105 | + return $this->$name; |
| 106 | + } |
| 107 | + |
| 108 | + /** |
| 109 | + * @internal |
| 110 | + */ |
| 111 | + public function __set($name, $value) |
| 112 | + { |
| 113 | + if ('validators' === $name || 'container' === $name) { |
| 114 | + @trigger_error(sprintf('Using the "%s::$%s" property is deprecated since version 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED); |
| 115 | + } |
| 116 | + |
| 117 | + $this->$name = $value; |
| 118 | + } |
| 119 | + |
| 120 | + /** |
| 121 | + * @internal |
| 122 | + */ |
| 123 | + public function __isset($name) |
| 124 | + { |
| 125 | + if ('validators' === $name || 'container' === $name) { |
| 126 | + @trigger_error(sprintf('Using the "%s::$%s" property is deprecated since version 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED); |
| 127 | + } |
| 128 | + |
| 129 | + return isset($this->$name); |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * @internal |
| 134 | + */ |
| 135 | + public function __unset($name) |
| 136 | + { |
| 137 | + if ('validators' === $name || 'container' === $name) { |
| 138 | + @trigger_error(sprintf('Using the "%s::$%s" property is deprecated since version 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED); |
| 139 | + } |
| 140 | + |
| 141 | + unset($this->$name); |
| 142 | + } |
88 | 143 | }
|
0 commit comments