Completed
Push — master ( cb517e...d88e38 )
by Adelar
02:26
created

OfxMovement::getDescription()   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 2
Bugs 1 Features 0
Metric Value
c 2
b 1
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
use DateTime;
6
7
/**
8
 *
9
 * @author Adelar Tiemann Junior <[email protected]>
10
 */
11
class OfxMovement
12
{
13
14
    private $document;
15
16
    private $description;
17
18
    private $amount;
19
20
    private $dueDate;
21
22 5
    public function __construct(SimpleXMLElement $xml)
23
    {
24 5
        $this->document = $xml->FITID;
0 ignored issues
show
Bug introduced by
The property FITID does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
25 5
        $this->description = $xml->MEMO;
0 ignored issues
show
Bug introduced by
The property MEMO does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
26 5
        $this->amount = (float) str_replace(',', '.', $xml->TRNAMT);
27 5
        $this->dueDate = new DateTime(substr($xml->DTPOSTED, 0, 8));
28 5
    }
29
30 1
    public function getDocument()
31
    {
32 1
        return $this->document;
33
    }
34
35 1
    public function getDescription()
36
    {
37 1
        return $this->description;
38
    }
39
40 1
    public function getAmount()
41
    {
42 1
        return $this->amount;
43
    }
44
45 1
    public function getDueDate()
46
    {
47 1
        return $this->dueDate;
48
    }
49
}
50