Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
CRAP
83.33% covered (warning)
83.33%
5 / 6
Valid
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
4.07
83.33% covered (warning)
83.33%
5 / 6
 __get
0.00% covered (danger)
0.00%
0 / 1
2.15
66.67% covered (warning)
66.67%
2 / 3
 addImplicitGroupName
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
<?php
/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
 * @Annotation
 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class Valid extends Constraint
{
    public $traverse = true;
    public function __get(string $option)
    {
        if ('groups' === $option) {
            // when this is reached, no groups have been configured
            return null;
        }
        return parent::__get($option);
    }
    /**
     * {@inheritdoc}
     */
    public function addImplicitGroupName($group)
    {
        if (null !== $this->groups) {
            parent::addImplicitGroupName($group);
        }
    }
}