Code Duplication    Length = 16-16 lines in 4 locations

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

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