Skip to content

Commit 9c29473

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [2.7][DX] Use constant message contextualisation for deprecations
2 parents 056dcc6 + b71e046 commit 9c29473

File tree

10 files changed

+25
-25
lines changed

10 files changed

+25
-25
lines changed

ConstraintViolation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function getMessageTemplate()
108108
*/
109109
public function getMessageParameters()
110110
{
111-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.7, to be removed in 3.0. Use the ConstraintViolation::getParameters() method instead.', E_USER_DEPRECATED);
111+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.7, to be removed in 3.0. Use the ConstraintViolation::getParameters() method instead.', E_USER_DEPRECATED);
112112

113113
return $this->parameters;
114114
}
@@ -129,7 +129,7 @@ public function getParameters()
129129
*/
130130
public function getMessagePluralization()
131131
{
132-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.7, to be removed in 3.0. Use the ConstraintViolation::getPlural() method instead.', E_USER_DEPRECATED);
132+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.7, to be removed in 3.0. Use the ConstraintViolation::getPlural() method instead.', E_USER_DEPRECATED);
133133

134134
return $this->plural;
135135
}

Constraints/GroupSequence.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function __construct(array $groups)
104104
*/
105105
public function getIterator()
106106
{
107-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
107+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
108108

109109
return new \ArrayIterator($this->groups);
110110
}
@@ -122,7 +122,7 @@ public function getIterator()
122122
*/
123123
public function offsetExists($offset)
124124
{
125-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
125+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
126126

127127
return isset($this->groups[$offset]);
128128
}
@@ -142,7 +142,7 @@ public function offsetExists($offset)
142142
*/
143143
public function offsetGet($offset)
144144
{
145-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
145+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
146146

147147
if (!isset($this->groups[$offset])) {
148148
throw new OutOfBoundsException(sprintf(
@@ -166,7 +166,7 @@ public function offsetGet($offset)
166166
*/
167167
public function offsetSet($offset, $value)
168168
{
169-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
169+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
170170

171171
if (null !== $offset) {
172172
$this->groups[$offset] = $value;
@@ -188,7 +188,7 @@ public function offsetSet($offset, $value)
188188
*/
189189
public function offsetUnset($offset)
190190
{
191-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
191+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
192192

193193
unset($this->groups[$offset]);
194194
}
@@ -204,7 +204,7 @@ public function offsetUnset($offset)
204204
*/
205205
public function count()
206206
{
207-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
207+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
208208

209209
return count($this->groups);
210210
}

Context/ExecutionContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function getPropertyPath($subPath = '')
321321
*/
322322
public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null)
323323
{
324-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED);
324+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED);
325325

326326
if (func_num_args() > 2) {
327327
$this
@@ -348,7 +348,7 @@ public function addViolationAt($subPath, $message, array $parameters = array(),
348348
*/
349349
public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false)
350350
{
351-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator() method instead.', E_USER_DEPRECATED);
351+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator() method instead.', E_USER_DEPRECATED);
352352

353353
if (is_array($value)) {
354354
// The $traverse flag is ignored for arrays
@@ -386,7 +386,7 @@ public function validate($value, $subPath = '', $groups = null, $traverse = fals
386386
*/
387387
public function validateValue($value, $constraints, $subPath = '', $groups = null)
388388
{
389-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator() method instead.', E_USER_DEPRECATED);
389+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator() method instead.', E_USER_DEPRECATED);
390390

391391
return $this
392392
->getValidator()

Mapping/Cache/ApcCache.php

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

1212
namespace Symfony\Component\Validator\Mapping\Cache;
1313

14-
@trigger_error('The '.__NAMESPACE__.'\ApcCache class is deprecated since version 2.5 and will be removed in 3.0. Use DoctrineCache with the Doctrine\Common\Cache\ApcCache class instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\ApcCache class is deprecated since Symfony 2.5 and will be removed in 3.0. Use DoctrineCache with the Doctrine\Common\Cache\ApcCache class instead.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Validator\Mapping\ClassMetadata;
1717

Mapping/ClassMetadata.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function __construct($class)
133133
*/
134134
public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null)
135135
{
136-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
136+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
137137

138138
if (null === $propagatedGroup && Constraint::DEFAULT_GROUP === $group
139139
&& ($this->hasGroupSequence() || $this->isGroupSequenceProvider())) {
@@ -423,7 +423,7 @@ public function mergeConstraints(ClassMetadata $source)
423423
*/
424424
protected function addMemberMetadata(MemberMetadata $metadata)
425425
{
426-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the addPropertyMetadata() method instead.', E_USER_DEPRECATED);
426+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the addPropertyMetadata() method instead.', E_USER_DEPRECATED);
427427

428428
$this->addPropertyMetadata($metadata);
429429
}
@@ -439,7 +439,7 @@ protected function addMemberMetadata(MemberMetadata $metadata)
439439
*/
440440
public function hasMemberMetadatas($property)
441441
{
442-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the hasPropertyMetadata() method instead.', E_USER_DEPRECATED);
442+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the hasPropertyMetadata() method instead.', E_USER_DEPRECATED);
443443

444444
return $this->hasPropertyMetadata($property);
445445
}
@@ -455,7 +455,7 @@ public function hasMemberMetadatas($property)
455455
*/
456456
public function getMemberMetadatas($property)
457457
{
458-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getPropertyMetadata() method instead.', E_USER_DEPRECATED);
458+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the getPropertyMetadata() method instead.', E_USER_DEPRECATED);
459459

460460
return $this->getPropertyMetadata($property);
461461
}

Mapping/MemberMetadata.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function __construct($class, $name, $property)
7474
*/
7575
public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null)
7676
{
77-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
77+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
7878

7979
$visitor->visit($this, $value, $group, $propertyPath);
8080

@@ -184,7 +184,7 @@ public function isPrivate($objectOrClassName)
184184
*/
185185
public function isCascaded()
186186
{
187-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getCascadingStrategy() method instead.', E_USER_DEPRECATED);
187+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getCascadingStrategy() method instead.', E_USER_DEPRECATED);
188188

189189
return (bool) ($this->cascadingStrategy & CascadingStrategy::CASCADE);
190190
}
@@ -200,7 +200,7 @@ public function isCascaded()
200200
*/
201201
public function isCollectionCascaded()
202202
{
203-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED);
203+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED);
204204

205205
return (bool) ($this->traversalStrategy & (TraversalStrategy::IMPLICIT | TraversalStrategy::TRAVERSE));
206206
}
@@ -216,7 +216,7 @@ public function isCollectionCascaded()
216216
*/
217217
public function isCollectionCascadedDeeply()
218218
{
219-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED);
219+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED);
220220

221221
return !($this->traversalStrategy & TraversalStrategy::STOP_RECURSION);
222222
}

Tests/Constraints/AbstractConstraintValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ protected function assertNoViolation()
256256
*/
257257
protected function assertViolation($message, array $parameters = array(), $propertyPath = 'property.path', $invalidValue = 'InvalidValue', $plural = null, $code = null)
258258
{
259-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED);
259+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED);
260260

261261
$this->buildViolation($message)
262262
->setParameters($parameters)
@@ -275,7 +275,7 @@ protected function assertViolation($message, array $parameters = array(), $prope
275275
*/
276276
protected function assertViolations(array $expected)
277277
{
278-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED);
278+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED);
279279

280280
$violations = $this->context->getViolations();
281281

Validator/LegacyValidator.php

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

1212
namespace Symfony\Component\Validator\Validator;
1313

14-
@trigger_error('The '.__NAMESPACE__.'\LegacyValidator class is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\LegacyValidator class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
1515

1616
/**
1717
* A validator that supports both the API of Symfony < 2.5 and Symfony 2.5+.

ValidatorBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function setTranslationDomain($translationDomain)
285285
*/
286286
public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor)
287287
{
288-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. The validator will function without a property accessor.', E_USER_DEPRECATED);
288+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. The validator will function without a property accessor.', E_USER_DEPRECATED);
289289

290290
if (null !== $this->validatorFactory) {
291291
throw new ValidatorException('You cannot set a property accessor after setting a custom validator factory. Configure your validator factory instead.');

Violation/LegacyConstraintViolationBuilder.php

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

1212
namespace Symfony\Component\Validator\Violation;
1313

14-
@trigger_error('The '.__NAMESPACE__.'\LegacyConstraintViolationBuilder class is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\LegacyConstraintViolationBuilder class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Validator\ExecutionContextInterface;
1717

0 commit comments

Comments
 (0)