Code Duplication    Length = 16-16 lines in 4 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaSecondFactorProjector.php 4 locations

@@ 122-137 (lines=16) @@
119
        $this->raSecondFactorRepository->save($secondFactor);
120
    }
121
122
    public function applyYubikeyPossessionProvenEvent(YubikeyPossessionProvenEvent $event)
123
    {
124
        $identity = $this->identityRepository->find((string) $event->identityId);
125
126
        $this->raSecondFactorRepository->save(
127
            new RaSecondFactor(
128
                (string) $event->secondFactorId,
129
                'yubikey',
130
                (string) $event->yubikeyPublicId,
131
                $identity->id,
132
                $identity->institution,
133
                $event->commonName,
134
                $event->email
135
            )
136
        );
137
    }
138
139
    public function applyPhonePossessionProvenEvent(PhonePossessionProvenEvent $event)
140
    {
@@ 139-154 (lines=16) @@
136
        );
137
    }
138
139
    public function applyPhonePossessionProvenEvent(PhonePossessionProvenEvent $event)
140
    {
141
        $identity = $this->identityRepository->find((string) $event->identityId);
142
143
        $this->raSecondFactorRepository->save(
144
            new RaSecondFactor(
145
                (string) $event->secondFactorId,
146
                'sms',
147
                (string) $event->phoneNumber,
148
                $identity->id,
149
                $identity->institution,
150
                $event->commonName,
151
                $event->email
152
            )
153
        );
154
    }
155
156
    public function applyGssfPossessionProvenEvent(GssfPossessionProvenEvent $event)
157
    {
@@ 156-171 (lines=16) @@
153
        );
154
    }
155
156
    public function applyGssfPossessionProvenEvent(GssfPossessionProvenEvent $event)
157
    {
158
        $identity = $this->identityRepository->find((string) $event->identityId);
159
160
        $this->raSecondFactorRepository->save(
161
            new RaSecondFactor(
162
                (string) $event->secondFactorId,
163
                (string) $event->stepupProvider,
164
                (string) $event->gssfId,
165
                $identity->id,
166
                $identity->institution,
167
                $event->commonName,
168
                $event->email
169
            )
170
        );
171
    }
172
173
    public function applyU2fDevicePossessionProvenEvent(U2fDevicePossessionProvenEvent $event)
174
    {
@@ 173-188 (lines=16) @@
170
        );
171
    }
172
173
    public function applyU2fDevicePossessionProvenEvent(U2fDevicePossessionProvenEvent $event)
174
    {
175
        $identity = $this->identityRepository->find((string) $event->identityId);
176
177
        $this->raSecondFactorRepository->save(
178
            new RaSecondFactor(
179
                (string) $event->secondFactorId,
180
                'u2f',
181
                $event->keyHandle->getValue(),
182
                $identity->id,
183
                $identity->institution,
184
                $event->commonName,
185
                $event->email
186
            )
187
        );
188
    }
189
190
    public function applyEmailVerifiedEvent(EmailVerifiedEvent $event)
191
    {