ConstraintValidatorInterface.php 869 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Validator;
  11. /**
  12. * @author Bernhard Schussek <bschussek@gmail.com>
  13. */
  14. interface ConstraintValidatorInterface
  15. {
  16. /**
  17. * Initializes the constraint validator.
  18. *
  19. * @param ExecutionContextInterface $context The current validation context
  20. */
  21. public function initialize(ExecutionContextInterface $context);
  22. /**
  23. * Checks if the passed value is valid.
  24. *
  25. * @param mixed $value The value that should be validated
  26. * @param Constraint $constraint The constraint for the validation
  27. */
  28. public function validate($value, Constraint $constraint);
  29. }