Skip to content

Commit 8558377

Browse files
committed
[Validator] Added deprecation notes
1 parent e8fa15b commit 8558377

15 files changed

+87
-11
lines changed

src/Symfony/Component/Validator/ClassBasedInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* An object backed by a PHP class.
1616
*
1717
* @author Bernhard Schussek <[email protected]>
18+
*
19+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
20+
* Use {@link Mapping\ClassMetadataInterface} instead.
1821
*/
1922
interface ClassBasedInterface
2023
{

src/Symfony/Component/Validator/Constraints/GroupSequence.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function __construct(array $groups)
9999
* @see \IteratorAggregate::getIterator()
100100
*
101101
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
102-
* To be removed in 3.0.
102+
* To be removed in Symfony 3.0.
103103
*/
104104
public function getIterator()
105105
{
@@ -114,7 +114,7 @@ public function getIterator()
114114
* @return Boolean Whether the offset exists
115115
*
116116
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
117-
* To be removed in 3.0.
117+
* To be removed in Symfony 3.0.
118118
*/
119119
public function offsetExists($offset)
120120
{
@@ -131,7 +131,7 @@ public function offsetExists($offset)
131131
* @throws OutOfBoundsException If the object does not exist
132132
*
133133
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
134-
* To be removed in 3.0.
134+
* To be removed in Symfony 3.0.
135135
*/
136136
public function offsetGet($offset)
137137
{
@@ -152,7 +152,7 @@ public function offsetGet($offset)
152152
* @param string $value The group name
153153
*
154154
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
155-
* To be removed in 3.0.
155+
* To be removed in Symfony 3.0.
156156
*/
157157
public function offsetSet($offset, $value)
158158
{
@@ -171,7 +171,7 @@ public function offsetSet($offset, $value)
171171
* @param integer $offset The offset
172172
*
173173
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
174-
* To be removed in 3.0.
174+
* To be removed in Symfony 3.0.
175175
*/
176176
public function offsetUnset($offset)
177177
{
@@ -184,7 +184,7 @@ public function offsetUnset($offset)
184184
* @return integer The number of groups
185185
*
186186
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
187-
* To be removed in 3.0.
187+
* To be removed in Symfony 3.0.
188188
*/
189189
public function count()
190190
{

src/Symfony/Component/Validator/Context/LegacyExecutionContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
* @since 2.5
2626
* @author Bernhard Schussek <[email protected]>
2727
*
28-
* @deprecated Implemented for backwards compatibility with Symfony < 2.5. To be
29-
* removed in 3.0.
28+
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
29+
* To be removed in Symfony 3.0.
3030
*/
3131
class LegacyExecutionContext extends ExecutionContext
3232
{

src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* @since 2.5
2222
* @author Bernhard Schussek <[email protected]>
2323
*
24-
* @deprecated Implemented for backwards compatibility with Symfony < 2.5. To be
25-
* removed in 3.0.
24+
* @deprecated Implemented for backwards compatibility with Symfony < 2.5.
25+
* To be removed in Symfony 3.0.
2626
*/
2727
class LegacyExecutionContextFactory implements ExecutionContextFactoryInterface
2828
{

src/Symfony/Component/Validator/ExecutionContext.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
*
2121
* @author Fabien Potencier <[email protected]>
2222
* @author Bernhard Schussek <[email protected]>
23+
*
24+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
25+
* Use {@link Context\ExecutionContext} instead.
2326
*/
2427
class ExecutionContext implements ExecutionContextInterface
2528
{

src/Symfony/Component/Validator/ExecutionContextInterface.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
* @author Bernhard Schussek <[email protected]>
8383
*
8484
* @api
85+
*
86+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
87+
* Use {@link Context\ExecutionContextInterface} instead.
8588
*/
8689
interface ExecutionContextInterface
8790
{
@@ -95,6 +98,10 @@ interface ExecutionContextInterface
9598
* @param integer|null $code The violation code.
9699
*
97100
* @api
101+
*
102+
* @deprecated The parameters $invalidValue, $pluralization and $code are
103+
* deprecated since version 2.5 and will be removed in
104+
* Symfony 3.0.
98105
*/
99106
public function addViolation($message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null);
100107

@@ -110,6 +117,10 @@ public function addViolation($message, array $params = array(), $invalidValue =
110117
* @param integer|null $code The violation code.
111118
*
112119
* @api
120+
*
121+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
122+
* Use {@link Context\ExecutionContextInterface::buildViolation()}
123+
* instead.
113124
*/
114125
public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $pluralization = null, $code = null);
115126

@@ -151,6 +162,10 @@ public function addViolationAt($subPath, $message, array $parameters = array(),
151162
* or an instance of <tt>\Traversable</tt>.
152163
* @param Boolean $deep Whether to traverse the value recursively if
153164
* it is a collection of collections.
165+
*
166+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
167+
* Use {@link Context\ExecutionContextInterface::getValidator()}
168+
* instead.
154169
*/
155170
public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false);
156171

@@ -180,6 +195,10 @@ public function validate($value, $subPath = '', $groups = null, $traverse = fals
180195
* @param null|string|string[] $groups The groups to validate in. If you don't pass any
181196
* groups here, the current group of the context
182197
* will be used.
198+
*
199+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
200+
* Use {@link Context\ExecutionContextInterface::getValidator()}
201+
* instead.
183202
*/
184203
public function validateValue($value, $constraints, $subPath = '', $groups = null);
185204

@@ -237,6 +256,12 @@ public function getMetadata();
237256
* Returns the used metadata factory.
238257
*
239258
* @return MetadataFactoryInterface The metadata factory.
259+
*
260+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
261+
* Use {@link Context\ExecutionContextInterface::getValidator()}
262+
* instead and call
263+
* {@link Validator\ValidatorInterface::getMetadataFor()} or
264+
* {@link Validator\ValidatorInterface::hasMetadataFor()} there.
240265
*/
241266
public function getMetadataFactory();
242267

src/Symfony/Component/Validator/GlobalExecutionContextInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
* </ul>
2727
*
2828
* @author Bernhard Schussek <[email protected]>
29+
*
30+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
31+
* Use {@link Context\ExecutionContextInterface} instead.
2932
*/
3033
interface GlobalExecutionContextInterface
3134
{

src/Symfony/Component/Validator/MetadataInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
* again.
4242
*
4343
* @author Bernhard Schussek <[email protected]>
44+
*
45+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
46+
* Use {@link Mapping\MetadataInterface} instead.
4447
*/
4548
interface MetadataInterface
4649
{
@@ -54,6 +57,8 @@ interface MetadataInterface
5457
* @param mixed $value The value to validate.
5558
* @param string|string[] $group The validation group to validate in.
5659
* @param string $propertyPath The current property path in the validation graph.
60+
*
61+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
5762
*/
5863
public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath);
5964

src/Symfony/Component/Validator/PropertyMetadataContainerInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* A container for {@link PropertyMetadataInterface} instances.
1616
*
1717
* @author Bernhard Schussek <[email protected]>
18+
*
19+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
20+
* Use {@link Mapping\ClassMetadataInterface} instead.
1821
*/
1922
interface PropertyMetadataContainerInterface
2023
{

src/Symfony/Component/Validator/PropertyMetadataInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
* @author Bernhard Schussek <[email protected]>
2424
*
2525
* @see MetadataInterface
26+
*
27+
* @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0.
28+
* Use {@link Mapping\PropertyMetadataInterface} instead.
2629
*/
2730
interface PropertyMetadataInterface extends MetadataInterface
2831
{

0 commit comments

Comments
 (0)