Passed
Push — master ( 751f0f...c8e8f6 )
by Pieter
01:39
created

ErrorBagField::getSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace W2w\Lib\ApieObjectAccessNormalizer\Errors;
5
6
use Throwable;
7
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\LocalizationInfo;
8
9
final class ErrorBagField
10
{
11
    /**
12
     * @var string
13
     */
14
    private $message;
15
16
    /**
17
     * @var LocalizationInfo|null
18
     */
19
    private $localizationInfo;
20
21
    /**
22
     * @var Throwable|null
23
     */
24
    private $source;
25
26
    public function __construct(string $message, ?LocalizationInfo $localizationInfo = null, ?Throwable $source = null)
27
    {
28
        $this->message = $message;
29
        $this->localizationInfo = $localizationInfo;
30
        $this->source = $source;
31
    }
32
33
    /**
34
     * Get the message.
35
     *
36
     * @return string
37
     */
38
    public function getMessage(): string
39
    {
40
        return $this->message;
41
    }
42
43
    /**
44
     * Get the localization info.
45
     *
46
     * @return LocalizationInfo|null
47
     */
48
    public function getLocalizationInfo(): ?LocalizationInfo
49
    {
50
        return $this->localizationInfo;
51
    }
52
53
    /**
54
     * Get the source.
55
     *
56
     * @return Throwable|null
57
     */
58
    public function getSource(): ?Throwable
59
    {
60
        return $this->source;
61
    }
62
}
63