Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / validator / Constraints / Valid.php
index 0fb782906522517ed03ee1aa7362e9fac5f9a750..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,24 +23,23 @@ class Valid extends Constraint
 {
     public $traverse = true;
 
-    /**
-     * @deprecated since version 2.5, to be removed in Symfony 3.0.
-     */
-    public $deep = 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;
         }
 
-        if (is_array($options) && array_key_exists('deep', $options)) {
-            @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);
-        }
+        return parent::__get($option);
+    }
 
-        parent::__construct($options);
+    /**
+     * {@inheritdoc}
+     */
+    public function addImplicitGroupName($group)
+    {
+        if (null !== $this->groups) {
+            parent::addImplicitGroupName($group);
+        }
     }
 }