CoreFiles by mySites.guru
ZeroComparisonConstraintTrait.php43 lines, 1,263 bytes, from Joomla_6.1.2-Stable-Full_Package.zip
Raw History Compare with 6.1.1
md5
afd5079adc0f5811ae2eb80854dc3d33
sha1
75dc19e152bc3aef25b90d17b8d97363e3179cd4
sha256
f2626187fac1f4fd1d678f74207a26b457eabc333a20ec36ec6607432b832a69
<?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 73 releases, Joomla 5.4.0-rc1 to 6.3.0-alpha1. See them all, or every version of this file.