Completed
Push — master ( b0d047...e9f17a )
by Adelar
03:30
created

Ofx::exportMovements()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
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
    public function getMovements(){
24
    	return $this->movements;
25
    }
26
27 4
    private function exportMovements(SimpleXMLElement $xml){
28 4
    	foreach ($xml as $value) {
29 4
    		$this->movements[] = new OfxMovement($value);
30 4
    	}
31 4
    }
32
}
33