BillingAddress::hydrateXml()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Loevgaard\AltaPay\Entity;
4
5
use Loevgaard\AltaPay\Hydrator\HydratableInterface;
6
7
class BillingAddress implements HydratableInterface
8
{
9
    use AddressTrait;
10
11 30
    public function hydrateXml(\SimpleXMLElement $xml)
12
    {
13 30
        if (!isset($xml->BillingAddress)) {
14 3
            return;
15
        }
16
17
        /** @var \SimpleXMLElement $billingAddress */
18 27
        $billingAddress = $xml->BillingAddress;
0 ignored issues
show
Bug introduced by
The property BillingAddress 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...
19
20 27
        $this->hydrateAddress($billingAddress);
21 27
    }
22
}
23