Passed
Pull Request — master (#248)
by Rustam
02:27
created

CompareTo::getHandlerClassName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Rule;
6
7
use Attribute;
8
9
/**
10
 * Validates the specified value with another value or attribute.
11
 *
12
 * The value being compared with a constant {@see CompareTo::$compareValue}, which is set
13
 * in the constructor.
14
 *
15
 * It supports different comparison operators, specified
16
 * via the {@see CompareTo::$operator}.
17
 *
18
 * The default comparison function is based on string values, which means the values
19
 * are compared byte by byte. When comparing numbers, make sure to change {@see CompareTo::$type} to
20
 * {@see CompareTo::TYPE_NUMBER} to enable numeric comparison.
21
 */
22
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
23
final class CompareTo extends Compare
24
{
25 2
    public function getHandlerClassName(): string
26
    {
27 2
        return CompareHandler::class;
28
    }
29
}
30