Passed
Pull Request — master (#275)
by Sergei
03:07
created

PureInputData   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

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

10 Methods

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