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

CompareTo   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHandlerClassName() 0 3 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