{
/**
* 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();
$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) {
*
* @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)
{
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.
*