Passed
Push — master ( 3456a7...4e79a2 )
by Alexander
02:34
created

AtLeastDto::getAttributeLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Support\Data;
6
7
use Yiisoft\Validator\AttributeTranslator\ArrayAttributeTranslator;
8
use Yiisoft\Validator\AttributeTranslatorInterface;
9
use Yiisoft\Validator\AttributeTranslatorProviderInterface;
10
use Yiisoft\Validator\Rule\AtLeast;
11
12
#[AtLeast(['a', 'b', 'c'])]
13
final class AtLeastDto implements AttributeTranslatorProviderInterface
14
{
15
    public function __construct(
16
        public ?int $a = null,
17
        public ?int $b = null,
18
        public ?int $c = null,
19
    ) {
20
    }
21
22
    public function getAttributeLabels(): array
23
    {
24
        return [
25
            'a' => 'A',
26
            'b' => 'B',
27
            'c' => 'C',
28
        ];
29
    }
30
31
    public function getAttributeTranslator(): ?AttributeTranslatorInterface
32
    {
33
        return new ArrayAttributeTranslator($this->getAttributeLabels());
34
    }
35
}
36