Completed
Push — master ( 705b66...046d7f )
by Adelar
02:26
created

Ofx::getMovements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Adelarcubs\OFXParser;
3
4
use SimpleXMLElement;
5
6
/**
7
 *
8
 * @author Adelar Tiemann Junior <[email protected]>
9
 */
10
class Ofx
11
{
12
13
    public $ofx;
14
15
    private $movements = [];
16
17 4
    public function __construct(SimpleXMLElement $xml)
18
    {
19 4
        $this->ofx = $xml;
20 4
        $this->exportMovements($xml->BANKMSGSRSV1->STMTTRNRS->STMTRS->BANKTRANLIST->STMTTRN);
21 4
    }
22
23 4
    public function getMovements()
24
    {
25 4
        return $this->movements;
26
    }
27
28 4
    private function exportMovements(SimpleXMLElement $xml)
29
    {
30 4
        foreach ($xml as $value) {
31 4
            $this->movements[] = new OfxMovement($value);
32
        }
33 4
    }
34
}
35