Completed
Pull Request — master (#80)
by
unknown
03:21
created

AddressClassification   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 15
ccs 5
cts 6
cp 0.8333
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php namespace Ups\Entity\AddressValidation;
2
3
class AddressClassification
4
{
5
    public $code;
6
    public $description;
7
8 2
    public function __construct(\SimpleXMLElement $object)
9
    {
10 2
        if ($object->count() == 0) {
11
            throw new \InvalidArgumentException(__METHOD__ . ': The passed object does not have any child nodes.');
12
        }
13 2
        $this->code = $object->Code;
0 ignored issues
show
Bug introduced by
The property Code 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...
14 2
        $this->description = $object->Description;
0 ignored issues
show
Bug introduced by
The property Description 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...
15 2
    }
16
17
}