Passed
Pull Request — master (#641)
by
unknown
03:47
created

Compare::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Rule;
6
7
use Attribute;
8
9
/**
10
 * Defines validation options to compare the specified value with "target" value provided directly
11
 * ({@see GreaterThanOrEqual::$targetValue}) or within an attribute ({@see GreaterThanOrEqual::$targetAttribute}).
12
 *
13
 * The default comparison is based on number values (including float values). It's also possible to compare values as
14
 * strings byte by byte and compare original values as is. See {@see GreaterThanOrEqual::$type} for all possible
15
 * options.
16
 *
17
 * It supports different comparison operators, specified via the {@see Compare::$operator}.
18
 *
19
 * There are shortcut classes to use instead of specifying operator manually:
20
 *
21
 * - {@see Equal} is a shortcut for `new Compare(operator: '==')` and `new Compare(operator: '===')`.
22
 * - {@see NotEqual} is a shortcut for `new Compare(operator: '!=')` and `new Compare(operator: '!==')`.
23
 * - {@see GreaterThan} is a shortcut for `new Compare(operator: '>')`.
24
 * - {@see GreaterThanOrEqual} is a shortcut for `new Compare(operator: '>=')`.
25
 * - {@see LessThan} is a shortcut for `new Compare(operator: '<')`.
26
 * - {@see LessThanOrEqual} is a shortcut for `new Compare(operator: '<=')`.
27
 *
28
 * @see CompareHandler
29
 */
30
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
31
final class Compare extends AbstractCompare
32
{
33
}
34