MessageViolationException::getField()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Werkspot\MessageBus\Bus\DeliveryChain\Middleware\Validation;
4
5
use RuntimeException;
6
7
class MessageViolationException extends RuntimeException
8
{
9
    /**
10
     * @var string
11
     */
12
    private $field;
13
14
    /**
15
     * @var string
16
     */
17
    private $error;
18
19
    /**
20
     * @var array
21
     */
22
    private $parameters;
23
24 3
    public function __construct(string $field, string $error, array $parameters = [])
25
    {
26 3
        $this->field = $field;
27 3
        $this->error = $error;
28 3
        $this->parameters = $parameters;
29
30 3
        parent::__construct($field . ': ' . $error);
31 3
    }
32
33 1
    public function getField(): string
34
    {
35 1
        return $this->field;
36
    }
37
38 1
    public function getError(): string
39
    {
40 1
        return $this->error;
41
    }
42
43 1
    public function getParameters(): array
44
    {
45 1
        return $this->parameters;
46
    }
47
}
48