| 1 | <?php |
||
| 14 | trait CorrectedAddressTrait |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Gets the corrected address |
||
| 18 | * |
||
| 19 | * @return array|null |
||
| 20 | */ |
||
| 21 | 3 | public function getCorrectedAddress() |
|
| 22 | { |
||
| 23 | 3 | if (!$this->hasCorrectedAddress()) { |
|
| 24 | 2 | return null; |
|
| 25 | } |
||
| 26 | |||
| 27 | return [ |
||
| 28 | 1 | 'street' => (string)$this->getData()->corrected_address['street'], |
|
| 29 | 1 | 'streetNo' => (string)$this->getData()->corrected_address['streetNo'], |
|
| 30 | 1 | 'zip' => (string)$this->getData()->corrected_address['zip'], |
|
| 31 | 1 | 'city' => (string)$this->getData()->corrected_address['city'], |
|
| 32 | 1 | 'country' => (string)$this->getData()->corrected_address['country'], |
|
| 33 | 1 | ]; |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return SimpleXMLElement |
||
| 38 | * |
||
| 39 | * @codeCoverageIgnore |
||
| 40 | */ |
||
| 41 | abstract public function getData(); |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | 3 | public function hasCorrectedAddress() |
|
| 50 | } |
||
| 51 |