Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / validator / Constraints / Valid.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator\Constraints;
13
14 use Symfony\Component\Validator\Constraint;
15
16 /**
17  * @Annotation
18  * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
19  *
20  * @author Bernhard Schussek <bschussek@gmail.com>
21  */
22 class Valid extends Constraint
23 {
24     public $traverse = true;
25
26     public function __get($option)
27     {
28         if ('groups' === $option) {
29             // when this is reached, no groups have been configured
30             return null;
31         }
32
33         return parent::__get($option);
34     }
35
36     /**
37      * {@inheritdoc}
38      */
39     public function addImplicitGroupName($group)
40     {
41         if (null !== $this->groups) {
42             parent::addImplicitGroupName($group);
43         }
44     }
45 }