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

Investment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getProperties() 0 5 1
A loadOfx() 0 3 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