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

CashOnDeliveryResponse::getIterator()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 2
nc 1
nop 0
crap 6
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