TrackingResponse::getPreparedAt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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 TrackingResponse implements \IteratorAggregate
17
{
18
    use ErrorAware;
0 ignored issues
show
Bug introduced by
The trait Appwilio\RussianPostSDK\Tracking\Packet\ErrorAware requires the property $Error which is not provided by Appwilio\RussianPostSDK\...Packet\TrackingResponse.
Loading history...
19
20
    /** @var Error|null */
21
    private $error;
0 ignored issues
show
introduced by
The private property $error is not used, and could be removed.
Loading history...
22
23
    /** @var ItemsWrapper */
24
    private $value;
25
26
    /**
27
     * Дата и время формирования билета по MSK (UTC+3).
28
     *
29
     * @return \DateTimeImmutable
30
     */
31 1
    public function getPreparedAt(): \DateTimeImmutable
32
    {
33 1
        return $this->value->getPreparedAt();
34
    }
35
36
    /**
37
     * Список почтовых отправлений.
38
     *
39
     * @return Item[]
40
     */
41 1
    public function getItems()
42
    {
43 1
        return $this->value->getItems();
44
    }
45
46 1
    public function getIterator()
47
    {
48
        return (function () {
49 1
            foreach ($this->getItems() as $item) {
50 1
                yield $item;
51
            }
52 1
        })();
53
    }
54
}
55