CoreFiles by mySites.guru
ZeroComparisonConstraintTrait.php43 lines, 1,261 bytes, from Joomla_5.3.3-Stable-Full_Package.zip
Raw History Compare with 5.3.2
md5
5502e05e239decbb14adef03b56b334a
sha1
73f2c0a13898aa5d5ea933e9ebbaa80020a1eb8f
sha256
55a714292734d1dc62611538d8a92a6eec91dfb55ae77ce9d5107b2766721d0d
<?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\Exception\ConstraintDefinitionException;

/**
 * @internal
 *
 * @author Jan Schädlich <[email protected]>
 * @author Alexander M. Turek <[email protected]>
 */
trait ZeroComparisonConstraintTrait
{
    public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null)
    {
        $options ??= [];

        if (isset($options['propertyPath'])) {
            throw new ConstraintDefinitionException(sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class));
        }

        if (isset($options['value'])) {
            throw new ConstraintDefinitionException(sprintf('The "value" option of the "%s" constraint cannot be set.', static::class));
        }

        parent::__construct(0, null, $message, $groups, $payload, $options);
    }

    public function validatedBy(): string
    {
        return parent::class.'Validator';
    }
}

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.