comparison vendor/symfony/validator/Constraints/Valid.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
10 */ 10 */
11 11
12 namespace Symfony\Component\Validator\Constraints; 12 namespace Symfony\Component\Validator\Constraints;
13 13
14 use Symfony\Component\Validator\Constraint; 14 use Symfony\Component\Validator\Constraint;
15 use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
16 15
17 /** 16 /**
18 * @Annotation 17 * @Annotation
19 * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) 18 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
20 * 19 *
22 */ 21 */
23 class Valid extends Constraint 22 class Valid extends Constraint
24 { 23 {
25 public $traverse = true; 24 public $traverse = true;
26 25
27 public function __construct($options = null) 26 public function __get($option)
28 { 27 {
29 if (is_array($options) && array_key_exists('groups', $options)) { 28 if ('groups' === $option) {
30 throw new ConstraintDefinitionException(sprintf( 29 // when this is reached, no groups have been configured
31 'The option "groups" is not supported by the constraint %s', 30 return null;
32 __CLASS__
33 ));
34 } 31 }
35 32
36 parent::__construct($options); 33 return parent::__get($option);
34 }
35
36 /**
37 * {@inheritdoc}
38 */
39 public function addImplicitGroupName($group)
40 {
41 if (null !== $this->groups) {
42 parent::addImplicitGroupName($group);
43 }
37 } 44 }
38 } 45 }