Passed
Push — main ( a20a2c...4724f2 )
by Breno
02:01
created

ErrorMessage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 2
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace BrenoRoosevelt\Validation;
5
6
final class ErrorMessage implements Error
7
{
8
    public function __construct(private string $message, private Rule $rule, private ?string $field = null)
9
    {
10
    }
11
12
    /** @inheritDoc */
13
    public function message(): string
14
    {
15
        return $this->message;
16
    }
17
18
    /** @inheritDoc */
19
    public function field(): ?string
20
    {
21
        return $this->field;
22
    }
23
24
    /** @inheritDoc */
25
    public function rule(): Rule
26
    {
27
        return $this->rule;
28
    }
29
}
30