Passed
Push — master ( 10cd5c...92ee40 )
by Jhao
02:18
created

TrackingEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 71
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getOperationName() 0 3 1
A getPostalCode() 0 3 1
A getAttributeId() 0 3 1
A getPerformedAt() 0 3 1
A getOperationId() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of RussianPost SDK package.
5
 *
6
 * © Appwilio (http://appwilio.com), greabock (https://github.com/greabock), JhaoDa (https://github.com/jhaoda)
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 Appwilio\RussianPostSDK\Tracking\Packet;
15
16
final class TrackingEvent
17
{
18
    /** @var int */
19
    private $OperTypeID;
20
21
    /** @var int */
22
    private $OperCtgID;
23
24
    /** @var string */
25
    private $OperName;
26
27
    /** @var string */
28
    private $DateOper;
29
30
    /** @var string */
31
    private $IndexOper;
32
33
    /**
34
     * Код операции (OperTypeID).
35
     *
36
     * @link https://tracking.pochta.ru/support/dictionaries/operation_codes
37
     *
38
     * @return int
39
     */
40 1
    public function getOperationId(): int
41
    {
42 1
        return $this->OperTypeID;
43
    }
44
45
    /**
46
     * Код атрибута (OperCtgID).
47
     *
48
     * @link https://tracking.pochta.ru/support/dictionaries/operation_codes
49
     *
50
     * @return int
51
     */
52 1
    public function getAttributeId(): int
53
    {
54 1
        return $this->OperCtgID;
55
    }
56
57
    /**
58
     * Название операции (OperName).
59
     *
60
     * @link https://tracking.pochta.ru/support/dictionaries/operation_codes
61
     *
62
     * @return string
63
     */
64 1
    public function getOperationName(): string
65
    {
66 1
        return $this->OperName;
67
    }
68
69
    /**
70
     * Время (локальное) проведения операции (DateOper).
71
     *
72
     * @return \DateTimeImmutable
73
     */
74 1
    public function getPerformedAt(): \DateTimeImmutable
75
    {
76 1
        return \DateTimeImmutable::createFromFormat('d.m.Y H:i:s', $this->DateOper);
77
    }
78
79
    /**
80
     * Почтовый индекс места проведения операции (IndexOper).
81
     *
82
     * @return string
83
     */
84 1
    public function getPostalCode(): string
85
    {
86 1
        return $this->IndexOper;
87
    }
88
}
89