Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / validator / Constraint.php
index fc5288d13bee7f2ec053720d91ee323db853b5b5..c5890c658aeaec6acdc11376be6a7295fc2e6768 100644 (file)
@@ -33,29 +33,21 @@ abstract class Constraint
 {
     /**
      * The name of the group given to all constraints with no explicit group.
-     *
-     * @var string
      */
     const DEFAULT_GROUP = 'Default';
 
     /**
      * Marks a constraint that can be put onto classes.
-     *
-     * @var string
      */
     const CLASS_CONSTRAINT = 'class';
 
     /**
      * Marks a constraint that can be put onto properties.
-     *
-     * @var string
      */
     const PROPERTY_CONSTRAINT = 'property';
 
     /**
      * Maps error codes to the names of their constants.
-     *
-     * @var array
      */
     protected static $errorNames = array();
 
@@ -141,7 +133,7 @@ abstract class Constraint
                     $invalidOptions[] = $option;
                 }
             }
-        } elseif (null !== $options && !(is_array($options) && count($options) === 0)) {
+        } elseif (null !== $options && !(is_array($options) && 0 === count($options))) {
             $option = $this->getDefaultOption();
 
             if (null === $option) {
@@ -209,7 +201,7 @@ abstract class Constraint
      *
      * @throws InvalidOptionsException If an invalid option name is given
      *
-     * @internal This method should not be used or overwritten in userland code.
+     * @internal this method should not be used or overwritten in userland code
      */
     public function __get($option)
     {
@@ -222,6 +214,16 @@ abstract class Constraint
         throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, get_class($this)), array($option));
     }
 
+    /**
+     * @param string $option The option name
+     *
+     * @return bool
+     */
+    public function __isset($option)
+    {
+        return 'groups' === $option;
+    }
+
     /**
      * Adds the given group if this constraint is in the Default group.
      *