CoreFiles by mySites.guru
CompoundValidator.php38 lines, 1,002 bytes, from Joomla_5.2.1-Stable-Full_Package.zip
Raw History Compare with 5.2.0
md5
390d548401e59e7533c7358ac0dfa085
sha1
6d803030112ffd4d0121237c6e0fa14fac912e0a
sha256
bc885b614ae9b0844673f17075ffac5316b2c8736b97d2c665b02b642ce90c79
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * 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;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;

/**
 * @author Maxime Steinhausser <[email protected]>
 */
class CompoundValidator extends ConstraintValidator
{
    /**
     * @return void
     */
    public function validate(mixed $value, Constraint $constraint)
    {
        if (!$constraint instanceof Compound) {
            throw new UnexpectedTypeException($constraint, Compound::class);
        }

        $context = $this->context;

        $validator = $context->getValidator()->inContext($context);

        $validator->validate($value, $constraint->constraints);
    }
}

The same content is in 136 releases, Joomla 5.1.0-beta1 to 6.3.0-alpha1. See them all, or every version of this file.