Completed
Push — master ( ad55a4...c98fe8 )
by Joachim
01:57
created

BillingAddressTrait::hydrateBillingAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Loevgaard\AltaPay\Entity;
4
5
trait BillingAddressTrait
6
{
7
    /**
8
     * @var BillingAddress
9
     */
10
    private $billingAddress;
11
12
13 9
    public function hydrateBillingAddress(\SimpleXMLElement $xml)
14
    {
15 9
        $billingAddress = new BillingAddress();
16 9
        $billingAddress->hydrateXml($xml);
17
18 9
        $this->billingAddress = $billingAddress;
19 9
    }
20
21
    /**
22
     * @return BillingAddress
23
     */
24
    public function getBillingAddress() : BillingAddress
25
    {
26
        return $this->billingAddress;
27
    }
28
}
29