Passed
Pull Request — master (#4)
by Agaletskiy
02:28
created

FacadeDocListV2ItemResponse::getDocDateDateTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\IsmpClient\V3\Dto;
6
7
use Symfony\Component\Serializer\Annotation\SerializedName;
8
9
final class FacadeDocListV2ItemResponse
10
{
11
    private const DATE_FORMAT = '';
12
13
    /**
14
     * @var string
15
     */
16
    private $number;
17
    /**
18
     * @var string
19
     * @SerializedName("docDate")
20
     */
21
    private $docDate;
22
    /**
23
     * @var string
24
     * @SerializedName("receivedAt")
25
     */
26
    private $receivedAt;
27
    /**
28
     * @var string
29
     */
30
    private $type;
31
    /**
32
     * @var string
33
     */
34
    private $status;
35
    /**
36
     * @var string
37
     * @SerializedName("senderName")
38
     */
39
    private $senderName;
40
41
    public function __construct(
42
        string $number,
43
        string $docDate,
44
        string $receivedAt,
45
        string $type,
46
        string $status,
47
        string $senderName
48
    ) {
49
        $this->number = $number;
50
        $this->docDate = $docDate;
51
        $this->receivedAt = $receivedAt;
52
        $this->type = $type;
53
        $this->status = $status;
54
        $this->senderName = $senderName;
55
    }
56
57
    public function getNumber(): string
58
    {
59
        return $this->number;
60
    }
61
62
    public function getDocDate(): string
63
    {
64
        return $this->docDate;
65
    }
66
67
    /**
68
     * @throws \Exception
69
     */
70
    public function getDocDateDateTime(): \DateTimeImmutable
71
    {
72
        return new \DateTimeImmutable($this->docDate);
73
    }
74
75
    public function getReceivedAt(): string
76
    {
77
        return $this->receivedAt;
78
    }
79
80
    /**
81
     * @throws \Exception
82
     */
83
    public function getReceivedAtDateTime(): \DateTimeImmutable
84
    {
85
        return new \DateTimeImmutable($this->receivedAt);
86
    }
87
88
    public function getType(): string
89
    {
90
        return $this->type;
91
    }
92
93
    public function getStatus(): string
94
    {
95
        return $this->status;
96
    }
97
98
    public function getSenderName(): string
99
    {
100
        return $this->senderName;
101
    }
102
}
103