Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e0385a2

Browse filesBrowse files
committed
[Validator] removed deprecated methods
1 parent 65e3b16 commit e0385a2
Copy full SHA for e0385a2
Expand file treeCollapse file tree

25 files changed

+8
-2671
lines changed

‎src/Symfony/Component/Validator/ConstraintValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/ConstraintValidator.php
-84Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\Validator;
1313

14-
use Symfony\Component\Validator\Exception\ValidatorException;
15-
1614
/**
1715
* Base class for constraint validators
1816
*
@@ -27,93 +25,11 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface
2725
*/
2826
protected $context;
2927

30-
/**
31-
* @var string
32-
*
33-
* @deprecated
34-
*/
35-
private $messageTemplate;
36-
37-
/**
38-
* @var array
39-
*
40-
* @deprecated
41-
*/
42-
private $messageParameters;
43-
4428
/**
4529
* {@inheritDoc}
4630
*/
4731
public function initialize(ExecutionContextInterface $context)
4832
{
4933
$this->context = $context;
50-
$this->messageTemplate = '';
51-
$this->messageParameters = array();
52-
}
53-
54-
/**
55-
* {@inheritDoc}
56-
*
57-
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
58-
*/
59-
public function getMessageTemplate()
60-
{
61-
trigger_error('getMessageTemplate() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
62-
63-
return $this->messageTemplate;
64-
}
65-
66-
/**
67-
* {@inheritDoc}
68-
*
69-
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
70-
*/
71-
public function getMessageParameters()
72-
{
73-
trigger_error('getMessageParameters() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
74-
75-
return $this->messageParameters;
76-
}
77-
78-
/**
79-
* Wrapper for $this->context->addViolation()
80-
*
81-
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
82-
*/
83-
protected function setMessage($template, array $parameters = array())
84-
{
85-
trigger_error('setMessage() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
86-
87-
$this->messageTemplate = $template;
88-
$this->messageParameters = $parameters;
89-
90-
if (!$this->context instanceof ExecutionContext) {
91-
throw new ValidatorException('ConstraintValidator::initialize() must be called before setting violation messages');
92-
}
93-
94-
$this->context->addViolation($template, $parameters);
95-
}
96-
97-
/**
98-
* Stub implementation delegating to the deprecated isValid method.
99-
*
100-
* This stub exists for BC and will be dropped in Symfony 2.3.
101-
*
102-
* @see ConstraintValidatorInterface::validate
103-
*/
104-
public function validate($value, Constraint $constraint)
105-
{
106-
trigger_error('isValid() is deprecated since version 2.1 and will be removed in 2.3. Implement validate() instead.', E_USER_DEPRECATED);
107-
108-
return $this->isValid($value, $constraint);
109-
}
110-
111-
/**
112-
* BC variant of validate.
113-
*
114-
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
115-
*/
116-
protected function isValid($value, Constraint $constraint)
117-
{
11834
}
11935
}

‎src/Symfony/Component/Validator/ExecutionContext.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/ExecutionContext.php
-126Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -112,64 +112,6 @@ public function addViolation($message, array $params = array(), $invalidValue =
112112
));
113113
}
114114

115-
/**
116-
* Adds a violation at the validation graph node with the given property
117-
* path.
118-
*
119-
* @param string $propertyPath The property path for the violation.
120-
* @param string $message The error message.
121-
* @param array $params The parameters parsed into the error message.
122-
* @param mixed $invalidValue The invalid, validated value.
123-
* @param integer|null $pluralization The number to use to pluralize of the message.
124-
* @param integer|null $code The violation code.
125-
*
126-
* @deprecated Deprecated since version 2.2, to be removed in 2.3.
127-
*/
128-
public function addViolationAtPath($propertyPath, $message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null)
129-
{
130-
trigger_error('addViolationAtPath() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);
131-
132-
$this->globalContext->getViolations()->add(new ConstraintViolation(
133-
null === $pluralization
134-
? $this->translator->trans($message, $params, $this->translationDomain)
135-
: $this->translator->transChoice($message, $pluralization, $params, $this->translationDomain),
136-
$message,
137-
$params,
138-
$this->globalContext->getRoot(),
139-
$propertyPath,
140-
// check using func_num_args() to allow passing null values
141-
func_num_args() >= 4 ? $invalidValue : $this->value,
142-
$pluralization,
143-
$code
144-
));
145-
}
146-
147-
/**
148-
* Adds a violation at the validation graph node with the given property
149-
* path relative to the current property path.
150-
*
151-
* @param string $subPath The relative property path for the violation.
152-
* @param string $message The error message.
153-
* @param array $params The parameters parsed into the error message.
154-
* @param mixed $invalidValue The invalid, validated value.
155-
* @param integer|null $pluralization The number to use to pluralize of the message.
156-
* @param integer|null $code The violation code.
157-
*
158-
* @deprecated Deprecated since version 2.2, to be removed in 2.3. Use the
159-
* method {@link addViolationAt} instead.
160-
*/
161-
public function addViolationAtSubPath($subPath, $message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null)
162-
{
163-
trigger_error('addViolationAtSubPath() is deprecated since version 2.2 and will be removed in 2.3. Use addViolationAt() instead.', E_USER_DEPRECATED);
164-
165-
if (func_num_args() >= 4) {
166-
$this->addViolationAt($subPath, $message, $params, $invalidValue, $pluralization, $code);
167-
} else {
168-
// Needed in order to make the check for func_num_args() inside work
169-
$this->addViolationAt($subPath, $message, $params);
170-
}
171-
}
172-
173115
/**
174116
* {@inheritdoc}
175117
*/
@@ -312,74 +254,6 @@ public function validateValue($value, $constraints, $subPath = '', $groups = nul
312254
}
313255
}
314256

315-
/**
316-
* Returns the class name of the current node.
317-
*
318-
* @return string|null The class name or null, if the current node does not
319-
* hold information about a class.
320-
*
321-
* @see getClassName
322-
*
323-
* @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
324-
* {@link getClassName} instead.
325-
*/
326-
public function getCurrentClass()
327-
{
328-
trigger_error('getCurrentClass() is deprecated since version 2.2 and will be removed in 2.3. Use getClassName() instead', E_USER_DEPRECATED);
329-
330-
return $this->getClassName();
331-
}
332-
333-
/**
334-
* Returns the property name of the current node.
335-
*
336-
* @return string|null The property name or null, if the current node does
337-
* not hold information about a property.
338-
*
339-
* @see getPropertyName
340-
*
341-
* @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
342-
* {@link getClassName} instead.
343-
*/
344-
public function getCurrentProperty()
345-
{
346-
trigger_error('getCurrentProperty() is deprecated since version 2.2 and will be removed in 2.3. Use getClassName() instead', E_USER_DEPRECATED);
347-
348-
return $this->getPropertyName();
349-
}
350-
351-
/**
352-
* Returns the currently validated value.
353-
*
354-
* @return mixed The current value.
355-
*
356-
* @see getValue
357-
*
358-
* @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
359-
* {@link getValue} instead.
360-
*/
361-
public function getCurrentValue()
362-
{
363-
trigger_error('getCurrentValue() is deprecated since version 2.2 and will be removed in 2.3. Use getValue() instead', E_USER_DEPRECATED);
364-
365-
return $this->value;
366-
}
367-
368-
/**
369-
* Returns the graph walker instance.
370-
*
371-
* @return GraphWalker The graph walker.
372-
*
373-
* @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
374-
* {@link validate} and {@link validateValue} instead.
375-
*/
376-
public function getGraphWalker()
377-
{
378-
trigger_error('getGraphWalker() is deprecated since version 2.2 and will be removed in 2.3. Use validate() and validateValue() instead', E_USER_DEPRECATED);
379-
380-
return $this->globalContext->getVisitor()->getGraphWalker();
381-
}
382-
383257
/**
384258
* {@inheritdoc}
385259
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.