Passed
Branch master (e17e02)
by Jacques
02:12
created

Investment::getProperties()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace OfxParser\Entities;
4
5
use SimpleXMLElement;
6
7
abstract class Investment extends AbstractEntity implements Inspectable, OfxLoadable
8
{
9
    /**
10
     * Get a list of properties defined for this entity.
11
     *
12
     * Since Traits are being used for multiple inheritance,
13
     * it can be challenging to know which properties exist
14
     * in the entity. 
15
     *
16
     * @return array array('prop_name' => 'prop_name', ...)
17
     */
18 1
    public function getProperties()
19
    {
20 1
        $props = array_keys(get_object_vars($this));
21
22 1
        return array_combine($props, $props);
23
    }
24
25
    /**
26
     * All Investment entities require a loadOfx method.
27
     * @param SimpleXMLElement $node
28
     * @return $this For chaining
29
     * @throws \Exception
30
     */
31 1
    public function loadOfx(SimpleXMLElement $node)
32
    {
33 1
        throw new \Exception('loadOfx method not defined in class "' . get_class() . '"');
34
    }
35
}
36
37