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

Ofx   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMovements() 0 4 1
A exportMovements() 0 6 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 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