X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraintValidator.php;fp=vendor%2Fsymfony%2Fvalidator%2FConstraintValidator.php;h=ece4400065c6a424a57835006e05fa231c97a939;hp=804a9b2a193ec444b63494a52f39ebf7e6506104;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/validator/ConstraintValidator.php b/vendor/symfony/validator/ConstraintValidator.php index 804a9b2a1..ece440006 100644 --- a/vendor/symfony/validator/ConstraintValidator.php +++ b/vendor/symfony/validator/ConstraintValidator.php @@ -11,9 +11,7 @@ namespace Symfony\Component\Validator; -use Symfony\Component\Validator\Context\ExecutionContextInterface as ExecutionContextInterface2Dot5; -use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; -use Symfony\Component\Validator\Violation\LegacyConstraintViolationBuilder; +use Symfony\Component\Validator\Context\ExecutionContextInterface; /** * Base class for constraint validators. @@ -38,7 +36,7 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface const OBJECT_TO_STRING = 2; /** - * @var ExecutionContextInterface2Dot5 + * @var ExecutionContextInterface */ protected $context; @@ -50,51 +48,6 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface $this->context = $context; } - /** - * Wrapper for {@link ExecutionContextInterface::buildViolation} that - * supports the 2.4 context API. - * - * @param string $message The violation message - * @param array $parameters The message parameters - * - * @return ConstraintViolationBuilderInterface The violation builder - * - * @deprecated since version 2.5, to be removed in 3.0. - */ - protected function buildViolation($message, array $parameters = array()) - { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - - if ($this->context instanceof ExecutionContextInterface2Dot5) { - return $this->context->buildViolation($message, $parameters); - } - - return new LegacyConstraintViolationBuilder($this->context, $message, $parameters); - } - - /** - * Wrapper for {@link ExecutionContextInterface::buildViolation} that - * supports the 2.4 context API. - * - * @param ExecutionContextInterface $context The context to use - * @param string $message The violation message - * @param array $parameters The message parameters - * - * @return ConstraintViolationBuilderInterface The violation builder - * - * @deprecated since version 2.5, to be removed in 3.0. - */ - protected function buildViolationInContext(ExecutionContextInterface $context, $message, array $parameters = array()) - { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - - if ($context instanceof ExecutionContextInterface2Dot5) { - return $context->buildViolation($message, $parameters); - } - - return new LegacyConstraintViolationBuilder($context, $message, $parameters); - } - /** * Returns a string representation of the type of the value. * @@ -136,7 +89,7 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface */ protected function formatValue($value, $format = 0) { - $isDateTime = $value instanceof \DateTime || $value instanceof \DateTimeInterface; + $isDateTime = $value instanceof \DateTimeInterface; if (($format & self::PRETTY_DATE) && $isDateTime) { if (class_exists('IntlDateFormatter')) {