Passed
Push — main ( 2bc5a4...5ffc2f )
by Vasil
16:31 queued 13:09
created

TrackedParcelOperation::setDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
/*
4
 * This file is part of the Neutrino package.
5
 *
6
 * (c) Vasil Dakov <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace VasilDakov\Speedy\Service\Track;
15
16
use DateTime;
17
use JMS\Serializer\Annotation as Serializer;
18
19
/**
20
 * Class TrackedParcelOperation.
21
 *
22
 * @author Vasil Dakov <[email protected]>
23
 * @copyright 2009-2023 Neutrino.bg
24
 *
25
 * @version 1.0
26
 * @psalm-suppress MissingConstructor
27
 * @Serializer\AccessType("public_method")
28
 */
29
class TrackedParcelOperation
30
{
31
    /**
32
     * @Serializer\Type("DateTime<'Y-m-d\TH:i:sP'>")
33
     */
34
    private \DateTime $dateTime;
35
36
    /**
37
     * @Serializer\Type("integer")
38
     */
39
    private int $operationCode;
40
41
    /**
42
     * @Serializer\Type("string")
43
     */
44
    private ?string $description = null;
45
46
    /**
47
     * @Serializer\Type("string")
48
     */
49
    private ?string $comment = null;
50
51
    /**
52
     * @Serializer\Type("string")
53
     */
54
    private ?string $place = null;
55
56
    /**
57
     * @Serializer\Type("array")
58
     */
59
    private array|null $additionalInfo;
60
61 1
    public function __construct(
62
        \DateTime $dateTime,
63
        int $operationCode,
64
        string $description,
65
        string $comment,
66
        string $place = null,
67
        ?array $additionalInfo = []
68
    ) {
69 1
        $this->dateTime = $dateTime;
70 1
        $this->operationCode = $operationCode;
71 1
        $this->description = $description;
72 1
        $this->comment = $comment;
73 1
        $this->place = $place;
74 1
        $this->additionalInfo = $additionalInfo;
75
    }
76
77
    public function getDateTime(): \DateTime
78
    {
79
        return $this->dateTime;
80
    }
81
82
    public function setDateTime(\DateTime $dateTime): void
83
    {
84
        $this->dateTime = $dateTime;
85
    }
86
87
    public function getOperationCode(): int
88
    {
89
        return $this->operationCode;
90
    }
91
92
    public function setOperationCode(int $operationCode): void
93
    {
94
        $this->operationCode = $operationCode;
95
    }
96
97
    public function getDescription(): ?string
98
    {
99
        return $this->description;
100
    }
101
102
    public function setDescription(?string $description): void
103
    {
104
        $this->description = $description;
105
    }
106
107
    public function getComment(): ?string
108
    {
109
        return $this->comment;
110
    }
111
112
    public function setComment(?string $comment): void
113
    {
114
        $this->comment = $comment;
115
    }
116
117 1
    public function getPlace(): ?string
118
    {
119 1
        return $this->place;
120
    }
121
122
    public function setPlace(?string $place): void
123
    {
124
        $this->place = $place;
125
    }
126
127 1
    public function getAdditionalInfo(): ?array
128
    {
129 1
        return $this->additionalInfo;
130
    }
131
132
    public function setAdditionalInfo(array $additionalInfo): void
133
    {
134
        $this->additionalInfo = $additionalInfo;
135
    }
136
}
137