CoreFiles by mySites.guru
Cascade.php47 lines, 1,288 bytes, from Joomla_5.3.0-Stable-Full_Package.zip
Raw History Compare with 5.2.6
md5
63a276bf74c4b16044e30531318bc2ef
sha1
dd04dad16d6c53fb4dbef88ba1b3cffabb624f52
sha256
9f32d831ccc41966110c72023002622b833a9e662814f5b785abb02a482efe34
<?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\Exception\ConstraintDefinitionException;

/**
 * @Annotation
 * @Target({"CLASS"})
 *
 * @author Jules Pietri <[email protected]>
 */
#[\Attribute(\Attribute::TARGET_CLASS)]
class Cascade extends Constraint
{
    public array $exclude = [];

    public function __construct(array|string|null $exclude = null, ?array $options = null)
    {
        if (\is_array($exclude) && !array_is_list($exclude)) {
            $options = array_merge($exclude, $options ?? []);
        } else {
            $this->exclude = array_flip((array) $exclude);
        }

        if (\is_array($options) && \array_key_exists('groups', $options)) {
            throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__));
        }

        parent::__construct($options);
    }

    public function getTargets(): string|array
    {
        return self::CLASS_CONSTRAINT;
    }
}

The same content is in 60 releases, Joomla 5.1.0-beta1 to 6.0.0-alpha3. See them all, or every version of this file.