Permalink
Browse files

[Validator] removed deprecated methods

  • Loading branch information...
1 parent 65e3b16 commit e0385a2c1ca544c6486dfb76e13514a3e82bf9aa @fabpot fabpot committed Mar 1, 2013
Showing with 8 additions and 2,671 deletions.
  1. +0 −84 src/Symfony/Component/Validator/ConstraintValidator.php
  2. +0 −126 src/Symfony/Component/Validator/ExecutionContext.php
  3. +0 −236 src/Symfony/Component/Validator/GraphWalker.php
  4. +1 −14 src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php
  5. +0 −63 src/Symfony/Component/Validator/Mapping/ClassMetadataFactoryAdapter.php
  6. +0 −30 src/Symfony/Component/Validator/Mapping/ClassMetadataFactoryInterface.php
  7. +0 −17 src/Symfony/Component/Validator/Mapping/MemberMetadata.php
  8. +0 −71 src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php
  9. +0 −140 src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php
  10. +0 −124 src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php
  11. +0 −140 src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php
  12. +0 −121 src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php
  13. +0 −138 src/Symfony/Component/Validator/Tests/ExecutionContextTest.php
  14. +0 −592 src/Symfony/Component/Validator/Tests/GraphWalkerTest.php
  15. +4 −21 src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php
  16. +0 −18 src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php
  17. +0 −76 src/Symfony/Component/Validator/Tests/ValidatorContextTest.php
  18. +0 −193 src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php
  19. +0 −21 src/Symfony/Component/Validator/ValidationVisitor.php
  20. +0 −10 src/Symfony/Component/Validator/ValidationVisitorInterface.php
  21. +1 −8 src/Symfony/Component/Validator/ValidatorBuilder.php
  22. +2 −5 src/Symfony/Component/Validator/ValidatorBuilderInterface.php
  23. +0 −124 src/Symfony/Component/Validator/ValidatorContext.php
  24. +0 −65 src/Symfony/Component/Validator/ValidatorContextInterface.php
  25. +0 −234 src/Symfony/Component/Validator/ValidatorFactory.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\Validator;
-use Symfony\Component\Validator\Exception\ValidatorException;
-
/**
* Base class for constraint validators
*
@@ -28,92 +26,10 @@
protected $context;
/**
- * @var string
- *
- * @deprecated
- */
- private $messageTemplate;
-
- /**
- * @var array
- *
- * @deprecated
- */
- private $messageParameters;
-
- /**
* {@inheritDoc}
*/
public function initialize(ExecutionContextInterface $context)
{
$this->context = $context;
- $this->messageTemplate = '';
- $this->messageParameters = array();
- }
-
- /**
- * {@inheritDoc}
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- public function getMessageTemplate()
- {
- trigger_error('getMessageTemplate() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- return $this->messageTemplate;
- }
-
- /**
- * {@inheritDoc}
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- public function getMessageParameters()
- {
- trigger_error('getMessageParameters() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- return $this->messageParameters;
- }
-
- /**
- * Wrapper for $this->context->addViolation()
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- protected function setMessage($template, array $parameters = array())
- {
- trigger_error('setMessage() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- $this->messageTemplate = $template;
- $this->messageParameters = $parameters;
-
- if (!$this->context instanceof ExecutionContext) {
- throw new ValidatorException('ConstraintValidator::initialize() must be called before setting violation messages');
- }
-
- $this->context->addViolation($template, $parameters);
- }
-
- /**
- * Stub implementation delegating to the deprecated isValid method.
- *
- * This stub exists for BC and will be dropped in Symfony 2.3.
- *
- * @see ConstraintValidatorInterface::validate
- */
- public function validate($value, Constraint $constraint)
- {
- trigger_error('isValid() is deprecated since version 2.1 and will be removed in 2.3. Implement validate() instead.', E_USER_DEPRECATED);
-
- return $this->isValid($value, $constraint);
- }
-
- /**
- * BC variant of validate.
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- protected function isValid($value, Constraint $constraint)
- {
}
}
@@ -113,64 +113,6 @@ public function addViolation($message, array $params = array(), $invalidValue =
}
/**
- * Adds a violation at the validation graph node with the given property
- * path.
- *
- * @param string $propertyPath The property path for the violation.
- * @param string $message The error message.
- * @param array $params The parameters parsed into the error message.
- * @param mixed $invalidValue The invalid, validated value.
- * @param integer|null $pluralization The number to use to pluralize of the message.
- * @param integer|null $code The violation code.
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3.
- */
- public function addViolationAtPath($propertyPath, $message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null)
- {
- trigger_error('addViolationAtPath() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- $this->globalContext->getViolations()->add(new ConstraintViolation(
- null === $pluralization
- ? $this->translator->trans($message, $params, $this->translationDomain)
- : $this->translator->transChoice($message, $pluralization, $params, $this->translationDomain),
- $message,
- $params,
- $this->globalContext->getRoot(),
- $propertyPath,
- // check using func_num_args() to allow passing null values
- func_num_args() >= 4 ? $invalidValue : $this->value,
- $pluralization,
- $code
- ));
- }
-
- /**
- * Adds a violation at the validation graph node with the given property
- * path relative to the current property path.
- *
- * @param string $subPath The relative property path for the violation.
- * @param string $message The error message.
- * @param array $params The parameters parsed into the error message.
- * @param mixed $invalidValue The invalid, validated value.
- * @param integer|null $pluralization The number to use to pluralize of the message.
- * @param integer|null $code The violation code.
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. Use the
- * method {@link addViolationAt} instead.
- */
- public function addViolationAtSubPath($subPath, $message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null)
- {
- trigger_error('addViolationAtSubPath() is deprecated since version 2.2 and will be removed in 2.3. Use addViolationAt() instead.', E_USER_DEPRECATED);
-
- if (func_num_args() >= 4) {
- $this->addViolationAt($subPath, $message, $params, $invalidValue, $pluralization, $code);
- } else {
- // Needed in order to make the check for func_num_args() inside work
- $this->addViolationAt($subPath, $message, $params);
- }
- }
-
- /**
* {@inheritdoc}
*/
public function addViolationAt($subPath, $message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null)
@@ -313,74 +255,6 @@ public function validateValue($value, $constraints, $subPath = '', $groups = nul
}
/**
- * Returns the class name of the current node.
- *
- * @return string|null The class name or null, if the current node does not
- * hold information about a class.
- *
- * @see getClassName
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
- * {@link getClassName} instead.
- */
- public function getCurrentClass()
- {
- trigger_error('getCurrentClass() is deprecated since version 2.2 and will be removed in 2.3. Use getClassName() instead', E_USER_DEPRECATED);
-
- return $this->getClassName();
- }
-
- /**
- * Returns the property name of the current node.
- *
- * @return string|null The property name or null, if the current node does
- * not hold information about a property.
- *
- * @see getPropertyName
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
- * {@link getClassName} instead.
- */
- public function getCurrentProperty()
- {
- trigger_error('getCurrentProperty() is deprecated since version 2.2 and will be removed in 2.3. Use getClassName() instead', E_USER_DEPRECATED);
-
- return $this->getPropertyName();
- }
-
- /**
- * Returns the currently validated value.
- *
- * @return mixed The current value.
- *
- * @see getValue
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
- * {@link getValue} instead.
- */
- public function getCurrentValue()
- {
- trigger_error('getCurrentValue() is deprecated since version 2.2 and will be removed in 2.3. Use getValue() instead', E_USER_DEPRECATED);
-
- return $this->value;
- }
-
- /**
- * Returns the graph walker instance.
- *
- * @return GraphWalker The graph walker.
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. Use
- * {@link validate} and {@link validateValue} instead.
- */
- public function getGraphWalker()
- {
- trigger_error('getGraphWalker() is deprecated since version 2.2 and will be removed in 2.3. Use validate() and validateValue() instead', E_USER_DEPRECATED);
-
- return $this->globalContext->getVisitor()->getGraphWalker();
- }
-
- /**
* {@inheritdoc}
*/
public function getMetadataFactory()
Oops, something went wrong.

0 comments on commit e0385a2

Please sign in to comment.