Passed
Pull Request — master (#58)
by Alexander
05:15 queued 02:40
created

TemplateRule   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getOptions() 0 3 1
A getHandlerClassName() 0 3 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Gii\Validator;
6
7
use Attribute;
8
use Yiisoft\Validator\SerializableRuleInterface;
9
10
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
11
final class TemplateRule implements SerializableRuleInterface
12
{
13
    public function __construct()
14
    {
15
    }
16
17
    public function getName(): string
18
    {
19
        return 'gii_template_rule';
20
    }
21
22
    public function getOptions(): array
23
    {
24
        return [];
25
    }
26
27 2
    public function getHandlerClassName(): string
28
    {
29 2
        return TemplateRuleHandler::class;
30
    }
31
}
32