Passed
Push — master ( e18482...3e6ebb )
by Alexander
11:33
created

ObjectWithLabelsProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValidationPropertyLabels() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Support\Data;
6
7
use Yiisoft\Validator\Label;
8
use Yiisoft\Validator\LabelsProviderInterface;
9
use Yiisoft\Validator\Rule\Number;
10
use Yiisoft\Validator\Rule\Required;
11
12
final class ObjectWithLabelsProvider implements LabelsProviderInterface
13
{
14
    #[Required(message: '{attribute} cannot be blank.')]
15
    public string $name = '';
16
17
    #[Number(min: 21, lessThanMinMessage: '{attribute} must be no less than {min}.')]
18
    #[Label('test age')]
19
    protected int $age = 17;
20
21
    #[Number(max: 100)]
22
    #[Label('test')]
23
    private int $number = 42;
0 ignored issues
show
introduced by
The private property $number is not used, and could be removed.
Loading history...
24
25
    public function getValidationPropertyLabels(): array
26
    {
27
        return [
28
            'name' => 'Имя',
29
            'age' => 'Возраст',
30
        ];
31
    }
32
}
33