Code Duplication    Length = 23-23 lines in 2 locations

Models/DTOs/Translators/BankAccountTranslator.php 2 locations

@@ 47-69 (lines=23) @@
44
        return $bankAccount;
45
    }
46
47
    public function translateMangoToIbanDto(BankAccount $bankAccount) : IbanBankAccount
48
    {
49
        $ibanBankAccount = new IbanBankAccount();
50
        $ibanBankAccount->setTag($bankAccount->Tag);
51
        $ibanBankAccount->setActive($bankAccount->Active);
52
        $ibanBankAccount->setCreationDate($bankAccount->CreationDate);
53
        $ibanBankAccount->setId($bankAccount->Id);
54
        $ibanBankAccount->setUserId($bankAccount->UserId);
55
        $ibanBankAccount->setOwnerName($bankAccount->OwnerName);
56
        $ibanBankAccount->setType($bankAccount->Type);
57
        $ibanBankAccount->setIban($bankAccount->Details->IBAN);
58
        $ibanBankAccount->setBic($bankAccount->Details->Bic);
59
60
        $address = new AddressDto();
61
        $address->setAddressLine1($bankAccount->OwnerAddress->AddressLine1);
62
        $address->setAddressLine2($bankAccount->OwnerAddress->AddressLine2);
63
        $address->setCity($bankAccount->OwnerAddress->City);
64
        $address->setCountry($bankAccount->OwnerAddress->Country);
65
        $address->setPostalCode($bankAccount->OwnerAddress->PostalCode);
66
        $address->setRegion($bankAccount->OwnerAddress->Region);
67
        $ibanBankAccount->setOwnerAddress($address);
68
        return $ibanBankAccount;
69
    }
70
71
    public function translateGbDtoToMango(GbBankAccount $gbBankAccount) : BankAccount
72
    {
@@ 89-111 (lines=23) @@
86
        return $bankAccount;
87
    }
88
89
    public function translateMangoToGbDto(BankAccount $bankAccount) : GbBankAccount
90
    {
91
        $gbBankAccount = new GbBankAccount();
92
        $gbBankAccount->setTag($bankAccount->Tag);
93
        $gbBankAccount->setActive($bankAccount->Active);
94
        $gbBankAccount->setCreationDate($bankAccount->CreationDate);
95
        $gbBankAccount->setId($bankAccount->Id);
96
        $gbBankAccount->setUserId($bankAccount->UserId);
97
        $gbBankAccount->setOwnerName($bankAccount->OwnerName);
98
        $gbBankAccount->setType($bankAccount->Type);
99
        $gbBankAccount->setSortCode($bankAccount->Details->SortCode);
100
        $gbBankAccount->setAccountNumber($bankAccount->Details->AccountNumber);
101
102
        $address = new AddressDto();
103
        $address->setAddressLine1($bankAccount->OwnerAddress->AddressLine1);
104
        $address->setAddressLine2($bankAccount->OwnerAddress->AddressLine2);
105
        $address->setCity($bankAccount->OwnerAddress->City);
106
        $address->setCountry($bankAccount->OwnerAddress->Country);
107
        $address->setPostalCode($bankAccount->OwnerAddress->PostalCode);
108
        $address->setRegion($bankAccount->OwnerAddress->Region);
109
        $gbBankAccount->setOwnerAddress($address);
110
        return $gbBankAccount;
111
    }
112
}
113