for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Genkgo\Camt\Camt053\Decoder;
use Genkgo\Camt\Decoder\EntryTransactionDetail as BaseDecoder;
use Genkgo\Camt\DTO;
use Genkgo\Camt\Iban;
use SimpleXMLElement;
class EntryTransactionDetail extends BaseDecoder
{
/**
* {@inheritdoc}
*/
public function getRelatedPartyAccount(?SimpleXMLElement $xmlRelatedPartyTypeAccount): ?DTO\Account
if (!$xmlRelatedPartyTypeAccount) {
return null;
}
if (false === isset($xmlRelatedPartyTypeAccount->Id)) {
if (isset($xmlRelatedPartyTypeAccount->Id->IBAN) && $ibanCode = (string) $xmlRelatedPartyTypeAccount->Id->IBAN) {
return new DTO\IbanAccount(new Iban($ibanCode));
if (false === isset($xmlRelatedPartyTypeAccount->Id->Othr)) {
$xmlOtherIdentification = $xmlRelatedPartyTypeAccount->Id->Othr;
$otherAccount = new DTO\OtherAccount((string) $xmlOtherIdentification->Id);
if (isset($xmlOtherIdentification->SchmeNm)) {
if (isset($xmlOtherIdentification->SchmeNm->Cd)) {
$otherAccount->setSchemeName((string) $xmlOtherIdentification->SchmeNm->Cd);
if (isset($xmlOtherIdentification->SchmeNm->Prtry)) {
$otherAccount->setSchemeName((string) $xmlOtherIdentification->SchmeNm->Prtry);
if (isset($xmlOtherIdentification->Issr)) {
$otherAccount->setIssuer((string) $xmlOtherIdentification->Issr);
return $otherAccount;