Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / validator / Constraints / Valid.php
index 439da3ae0056a4177fb8da765ad7fefa014e968f..893942377851f2ba832fdf3d7ba9c7104c7dd417 100644 (file)
@@ -12,7 +12,6 @@
 namespace Symfony\Component\Validator\Constraints;
 
 use Symfony\Component\Validator\Constraint;
-use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
 
 /**
  * @Annotation
@@ -24,15 +23,23 @@ class Valid extends Constraint
 {
     public $traverse = true;
 
-    public function __construct($options = null)
+    public function __get($option)
     {
-        if (is_array($options) && array_key_exists('groups', $options)) {
-            throw new ConstraintDefinitionException(sprintf(
-                'The option "groups" is not supported by the constraint %s',
-                __CLASS__
-            ));
+        if ('groups' === $option) {
+            // when this is reached, no groups have been configured
+            return null;
         }
 
-        parent::__construct($options);
+        return parent::__get($option);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function addImplicitGroupName($group)
+    {
+        if (null !== $this->groups) {
+            parent::addImplicitGroupName($group);
+        }
     }
 }