Passed
Pull Request — master (#151)
by
unknown
02:01
created

Error::getStringValuePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
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
    private array $valuePath;
11
12 129
    public function __construct(string $message, array $valuePath = [])
13
    {
14 129
        $this->message = $message;
15 129
        $this->valuePath = $valuePath;
16 129
    }
17
18 34
    public function getMessage(): string
19
    {
20 34
        return $this->message;
21
    }
22
23
    /**
24
     * @psalm-return array<int|string>
25
     */
26 17
    public function getValuePath(): ?array
27
    {
28 17
        return $this->valuePath;
29
    }
30
}
31