Code Duplication    Length = 16-16 lines in 2 locations

Models/DTOs/Translators/UserTranslator.php 2 locations

@@ 23-38 (lines=16) @@
20
21
class UserTranslator
22
{
23
    public function convertDTOToMangoPayNaturalUser(PFUserNatural $userDto)
24
    {
25
        $mangoUser = new UserNatural();
26
        $mangoUser->PersonType = MangoPayConstants::NATURAL_PERSON_TYPE;
27
        $mangoUser->FirstName = $userDto->getFirstName();
28
        $mangoUser->LastName = $userDto->getLastName();
29
        $mangoUser->Birthday = (int) $userDto->getBirthday();
30
        $mangoUser->Nationality = $userDto->getNationality();
31
        $mangoUser->CountryOfResidence = $userDto->getCountryOfResidence();
32
        $mangoUser->Email = $userDto->getEmail();
33
        $mangoUser->Tag = $userDto->getTag();
34
        if ($userDto->getId()) {
35
            $mangoUser->Id = $userDto->getId();
36
        }
37
        return $mangoUser;
38
    }
39
40
    public function convertMangoPayNaturalUserToDTO(UserNatural $mangoUser)
41
    {
@@ 55-70 (lines=16) @@
52
        return $userDto;
53
    }
54
55
    public function convertDTOToMangoPayLegalUser(PFUserLegal $userDto)
56
    {
57
        $mangoUser = new UserLegal();
58
        $mangoUser->PersonType = MangoPayConstants::LEAGAL_PERSON_TYPE;
59
        $mangoUser->Name = $userDto->getFirstName() . " " . $userDto->getLastName();
60
        $mangoUser->LastName = $userDto->getLastName();
61
        $mangoUser->Birthday = (int) $userDto->getLegalRepresentativeBirthday();
62
        $mangoUser->Nationality = $userDto->getNationality();
63
        $mangoUser->CountryOfResidence = $userDto->getCountryOfResidence();
64
        $mangoUser->Email = $userDto->getEmail();
65
        $mangoUser->Tag = $userDto->getTag();
66
        if ($userDto->getId()) {
67
            $mangoUser->Id = $userDto->getId();
68
        }
69
        return $mangoUser;
70
    }
71
72
    public function convertMangoPayLegalUserToDTO(UserNatural $mangoUser)
73
    {