Drupal investigation

Valid.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\Constraints;
  11. use Symfony\Component\Validator\Constraint;
  12. use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
  13. /**
  14. * @Annotation
  15. * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
  16. *
  17. * @author Bernhard Schussek <bschussek@gmail.com>
  18. */
  19. class Valid extends Constraint
  20. {
  21. public $traverse = true;
  22. /**
  23. * @deprecated since version 2.5, to be removed in Symfony 3.0.
  24. */
  25. public $deep = true;
  26. public function __construct($options = null)
  27. {
  28. if (is_array($options) && array_key_exists('groups', $options)) {
  29. throw new ConstraintDefinitionException(sprintf(
  30. 'The option "groups" is not supported by the constraint %s',
  31. __CLASS__
  32. ));
  33. }
  34. if (is_array($options) && array_key_exists('deep', $options)) {
  35. @trigger_error('The "deep" option for the Valid constraint is deprecated since version 2.5 and will be removed in 3.0. When traversing arrays, nested arrays are always traversed. When traversing nested objects, their traversal strategy is used.', E_USER_DEPRECATED);
  36. }
  37. parent::__construct($options);
  38. }
  39. }