Code Duplication    Length = 15-16 lines in 2 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaCandidateProjector.php 2 locations

@@ 97-112 (lines=16) @@
94
            $institutions[$authorization->institution->getInstitution()] = new Institution($authorization->institution->getInstitution());
95
        }
96
97
        foreach ($institutions as $institution) {
98
            if ($this->raListingRepository->findByIdentityIdAndInstitution($event->identityId, $institution)) {
99
                continue;
100
            }
101
102
            $candidate = RaCandidate::nominate(
103
                $event->identityId,
104
                $event->identityInstitution,
105
                $event->nameId,
106
                $event->commonName,
107
                $event->email,
108
                $institution
109
            );
110
111
            $this->raCandidateRepository->merge($candidate);
112
        }
113
    }
114
115
    /**
@@ 124-138 (lines=15) @@
121
        $institutionAuthorizations = $this->institutionAuthorizationRepository
122
            ->findAuthorizationOptionsForInstitution(new ConfigurationInstitution($event->identityInstitution->getInstitution()));
123
124
        foreach ($institutionAuthorizations as $authorization) {
125
126
            $institution = new Institution($authorization->institution->getInstitution());
127
128
            $candidate = RaCandidate::nominate(
129
                $event->identityId,
130
                $event->identityInstitution,
131
                $event->nameId,
132
                $event->commonName,
133
                $event->email,
134
                $institution
135
            );
136
137
            $this->raCandidateRepository->merge($candidate);
138
        }
139
    }
140
141
    /**