| Conditions | 7 |
| Paths | 48 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 7.0178 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | 23 | public static function createFromXml(SimpleXMLElement $xmlRecipient): DTO\Recipient |
|
| 13 | { |
||
| 14 | 23 | $recipient = new DTO\Recipient(); |
|
| 15 | |||
| 16 | 23 | if (isset($xmlRecipient->Nm)) { |
|
| 17 | 23 | $recipient->setName((string) $xmlRecipient->Nm); |
|
| 18 | } |
||
| 19 | 23 | if (isset($xmlRecipient->PstlAdr)) { |
|
| 20 | 23 | $recipient->setAddress(Address::createFromXml($xmlRecipient->PstlAdr)); |
|
| 21 | } |
||
| 22 | 23 | if (isset($xmlRecipient->CtryOfRes)) { |
|
| 23 | 23 | $recipient->setCountryOfResidence((string) $xmlRecipient->CtryOfRes); |
|
| 24 | } |
||
| 25 | 23 | if (isset($xmlRecipient->CtctDtls)) { |
|
| 26 | $recipient->setContactDetails(ContactDetails::createFromXml($xmlRecipient->CtctDtls)); |
||
| 27 | } |
||
| 28 | 23 | if (isset($xmlRecipient->Id)) { |
|
| 29 | 23 | if (isset($xmlRecipient->Id->OrgId)) { |
|
| 30 | 23 | $recipient->setIdentification(OrganisationIdentification::createFromXml($xmlRecipient->Id->OrgId)); |
|
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | 23 | return $recipient; |
|
| 35 | } |
||
| 37 |