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

ErrorBagField   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
c 1
b 0
f 1
dl 0
loc 52
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLocalizationInfo() 0 3 1
A getSource() 0 3 1
A getMessage() 0 3 1
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