Passed
Push — master ( 480a58...1d93b8 )
by Jhao
02:09
created

CashOnDeliveryResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
dl 0
loc 20
rs 10
c 1
b 0
f 0
ccs 0
cts 2
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEvents() 0 3 1
A getIterator() 0 5 2
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\Single;
15
16
class CashOnDeliveryResponse implements \IteratorAggregate
17
{
18
    /** @var CashOnDeliveryEventsWrapper */
19
    private $PostalOrderEventsForMaiOutput;
20
21
    /**
22
     * Список операций с наложенным платежом, который связан с почтовым отправлением.
23
     *
24
     * @return CashOnDeliveryEvent[]
25
     */
26
    public function getEvents()
27
    {
28
        return $this->PostalOrderEventsForMaiOutput->getPostalOrderEvent();
29
    }
30
31
    public function getIterator()
32
    {
33
        return (function () {
34
            foreach ($this->getEvents() as $operation) {
35
                yield $operation;
36
            }
37
        })();
38
    }
39
}
40