Sequentially.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /**
  12. * Use this constraint to sequentially validate nested constraints.
  13. * Validation for the nested constraints collection will stop at first violation.
  14. *
  15. * @Annotation
  16. * @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
  17. *
  18. * @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
  19. */
  20. class Sequentially extends Composite
  21. {
  22. public $constraints = [];
  23. public function getDefaultOption()
  24. {
  25. return 'constraints';
  26. }
  27. public function getRequiredOptions()
  28. {
  29. return ['constraints'];
  30. }
  31. protected function getCompositeOption()
  32. {
  33. return 'constraints';
  34. }
  35. public function getTargets()
  36. {
  37. return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT];
  38. }
  39. }