Passed
Push — master ( 72c1ff...1d076d )
by Alexander
02:24
created

Error   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 7
c 1
b 1
f 1
dl 0
loc 29
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValuePath() 0 3 1
A getMessage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator;
6
7
final class Error
8
{
9
    private string $message;
10
11
    /**
12
     * @psalm-var list<int|string>
13
     */
14
    private array $valuePath;
15
16
    /**
17
     * @psalm-param list<int|string> $valuePath
18
     */
19 144
    public function __construct(string $message, array $valuePath = [])
20
    {
21 144
        $this->message = $message;
22 144
        $this->valuePath = $valuePath;
23 144
    }
24
25 44
    public function getMessage(): string
26
    {
27 44
        return $this->message;
28
    }
29
30
    /**
31
     * @psalm-return list<int|string>
32
     */
33 24
    public function getValuePath(): array
34
    {
35 24
        return $this->valuePath;
36
    }
37
}
38