Passed
Pull Request — master (#275)
by Sergei
02:49
created

PureInputData   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 51
ccs 18
cts 20
cp 0.9
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getValidationErrors() 0 3 1
A __construct() 0 4 1
A isValidated() 0 3 1
A getPlaceholder() 0 3 1
A getValue() 0 3 1
A getLabel() 0 3 1
A getId() 0 3 1
A getHint() 0 3 1
A getValidationRules() 0 3 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Form\Field\Base\InputData;
6
7
final class PureInputData implements InputDataInterface
8
{
9 116
    public function __construct(
10
        private ?string $name = null,
11
        private mixed $value = null,
12
    ) {
13 116
    }
14
15
    public function getValidationRules(): array
16
    {
17
        return [];
18
    }
19
20 1
    public function getName(): ?string
21
    {
22 1
        return $this->name;
23
    }
24
25 1
    public function getValue(): mixed
26
    {
27 1
        return $this->value;
28
    }
29
30 107
    public function getLabel(): ?string
31
    {
32 107
        return null;
33
    }
34
35 107
    public function getHint(): ?string
36
    {
37 107
        return null;
38
    }
39
40 1
    public function getPlaceholder(): ?string
41
    {
42 1
        return null;
43
    }
44
45 7
    public function getId(): ?string
46
    {
47 7
        return null;
48
    }
49
50 1
    public function isValidated(): bool
51
    {
52 1
        return false;
53
    }
54
55 107
    public function getValidationErrors(): array
56
    {
57 107
        return [];
58
    }
59
}
60