X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraint.php;fp=vendor%2Fsymfony%2Fvalidator%2FConstraint.php;h=c5890c658aeaec6acdc11376be6a7295fc2e6768;hp=fc5288d13bee7f2ec053720d91ee323db853b5b5;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/symfony/validator/Constraint.php b/vendor/symfony/validator/Constraint.php index fc5288d13..c5890c658 100644 --- a/vendor/symfony/validator/Constraint.php +++ b/vendor/symfony/validator/Constraint.php @@ -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. *