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

Error::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 2
c 1
b 1
f 1
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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