for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Validator\Rule;
use Attribute;
use Closure;
use InvalidArgumentException;
use JetBrains\PhpStorm\ArrayShape;
use RuntimeException;
use Yiisoft\Validator\ParametrizedRuleInterface;
use Yiisoft\Validator\BeforeValidationInterface;
use Yiisoft\Validator\Rule\Trait\HandlerClassNameTrait;
use Yiisoft\Validator\Rule\Trait\BeforeValidationTrait;
use Yiisoft\Validator\Rule\Trait\RuleNameTrait;
use Yiisoft\Validator\ValidationContext;
/**
* Validates the specified value with another value or attribute.
*
* The value being compared with a constant {@see CompareTo::$compareValue}, which is set
* in the constructor.
* It supports different comparison operators, specified
* via the {@see CompareTo::$operator}.
* The default comparison function is based on string values, which means the values
* are compared byte by byte. When comparing numbers, make sure to change {@see CompareTo::$type} to
* {@see CompareTo::TYPE_NUMBER} to enable numeric comparison.
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
final class CompareTo extends Compare
{
public function getHandlerClassName(): string
return CompareHandler::class;
}