Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / validator / Tests / Fixtures / ConstraintAValidator.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\Tests\Fixtures;
13
14 use Symfony\Component\Validator\Constraint;
15 use Symfony\Component\Validator\ConstraintValidator;
16 use Symfony\Component\Validator\Context\ExecutionContextInterface;
17
18 class ConstraintAValidator extends ConstraintValidator
19 {
20     public static $passedContext;
21
22     public function initialize(ExecutionContextInterface $context)
23     {
24         parent::initialize($context);
25
26         self::$passedContext = $context;
27     }
28
29     public function validate($value, Constraint $constraint)
30     {
31         if ('VALID' != $value) {
32             $this->context->addViolation('message', array('param' => 'value'));
33
34             return;
35         }
36     }
37 }