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

SellSecurity   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadOfx() 0 8 1
1
<?php
2
3
namespace OfxParser\Entities\Investment\Transaction;
4
5
use SimpleXMLElement;
6
use OfxParser\Entities\AbstractEntity;
7
use OfxParser\Entities\Investment;
8
use OfxParser\Entities\Investment\Transaction\Traits\InvTran;
9
use OfxParser\Entities\Investment\Transaction\Traits\SecId;
10
use OfxParser\Entities\Investment\Transaction\Traits\Pricing;
11
12
/**
13
 * OFX 203 doc:
14
 * 13.9.2.4.3 Investment Buy/Sell Aggregates <INVBUY>/<INVSELL>
15
 *
16
 * Properties found in the <INVSELL> aggregate.
17
 * Used for "other securities" SELL activities and provides the 
18
 * base properties to extend for more specific activities.
19
 *
20
 * Required:
21
 * <INVTRAN> aggregate
22
 * <SECID> aggregate
23
 * <UNITS>
24
 * <UNITPRICE>
25
 * <TOTAL>
26
 * <SUBACCTSEC>
27
 * <SUBACCTFUND>
28
 *
29
 * Optional:
30
 * ...many...
31
 *
32
 * Partial implementation.
33
 */
34
class SellSecurity extends Investment
35
{
36
    /**
37
     * Traits used to define properties
38
     */
39
    use InvTran;
0 ignored issues
show
introduced by
The trait OfxParser\Entities\Inves...nsaction\Traits\InvTran requires some properties which are not provided by OfxParser\Entities\Inves...ransaction\SellSecurity: $FITID, $DTTRADE, $DTSETTLE, $MEMO
Loading history...
40
    use SecId;
0 ignored issues
show
introduced by
The trait OfxParser\Entities\Inves...ransaction\Traits\SecId requires some properties which are not provided by OfxParser\Entities\Inves...ransaction\SellSecurity: $UNIQUEID, $UNIQUEIDTYPE
Loading history...
41
    use Pricing;
0 ignored issues
show
introduced by
The trait OfxParser\Entities\Inves...nsaction\Traits\Pricing requires some properties which are not provided by OfxParser\Entities\Inves...ransaction\SellSecurity: $UNITS, $UNITPRICE, $SUBACCTFUND, $TOTAL, $SUBACCTSEC
Loading history...
42
43
    /**
44
     * @var string
45
     */
46
    public $nodeName = 'SELLOTHER';
47
48
    /**
49
     * Imports the OFX data for this node.
50
     * @param SimpleXMLElement $node
51
     * @return $this
52
     */
53
    public function loadOfx(SimpleXMLElement $node)
54
    {
55
        // Transaction data is nested within <INVBUY> child node
56
        $this->loadInvTran($node->INVSELL->INVTRAN)
57
            ->loadSecId($node->INVSELL->SECID)
58
            ->loadPricing($node->INVSELL);
59
60
        return $this;
61
    }
62
}
63
64