CoreFiles by mySites.guru
EnableAutoMapping.php43 lines, 1,297 bytes, from Joomla_5.4.0-beta3-Beta-Full_Package.zip
Raw History Compare with 5.4.0-beta2
md5
2ff0cc344c1dcdd5c6f3e4bef3895238
sha1
2a78358b44f587a00594021084ce34e5482f3966
sha256
92d57de3cc6fc92d5fafc64de9fff99afe489ff096f9fc8c1b905052c194d12a
<?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;

/**
 * Enables auto mapping.
 *
 * Using the annotations on a property has higher precedence than using it on a class,
 * which has higher precedence than any configuration that might be defined outside the class.
 *
 * @Annotation
 *
 * @author Kévin Dunglas <[email protected]>
 */
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)]
class EnableAutoMapping extends Constraint
{
    public function __construct(?array $options = null)
    {
        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::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT];
    }
}

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