Code Duplication    Length = 13-13 lines in 3 locations

src/Surfnet/StepupMiddleware/CommandHandlingBundle/Identity/CommandHandler/IdentityCommandHandler.php 3 locations

@@ 134-146 (lines=13) @@
131
        $this->repository->save($identity);
132
    }
133
134
    public function handleProveYubikeyPossessionCommand(ProveYubikeyPossessionCommand $command)
135
    {
136
        /** @var IdentityApi $identity */
137
        $identity = $this->repository->load(new IdentityId($command->identityId));
138
139
        $identity->provePossessionOfYubikey(
140
            new SecondFactorId($command->secondFactorId),
141
            new YubikeyPublicId($command->yubikeyPublicId),
142
            $this->configurableSettings->createNewEmailVerificationWindow()
143
        );
144
145
        $this->repository->save($identity);
146
    }
147
148
    /**
149
     * @param ProvePhonePossessionCommand $command
@@ 151-163 (lines=13) @@
148
    /**
149
     * @param ProvePhonePossessionCommand $command
150
     */
151
    public function handleProvePhonePossessionCommand(ProvePhonePossessionCommand $command)
152
    {
153
        /** @var IdentityApi $identity */
154
        $identity = $this->repository->load(new IdentityId($command->identityId));
155
156
        $identity->provePossessionOfPhone(
157
            new SecondFactorId($command->secondFactorId),
158
            new PhoneNumber($command->phoneNumber),
159
            $this->configurableSettings->createNewEmailVerificationWindow()
160
        );
161
162
        $this->repository->save($identity);
163
    }
164
165
    /**
166
     * @param ProveGssfPossessionCommand $command
@@ 183-195 (lines=13) @@
180
        $this->repository->save($identity);
181
    }
182
183
    public function handleProveU2fDevicePossessionCommand(ProveU2fDevicePossessionCommand $command)
184
    {
185
        /** @var IdentityApi $identity */
186
        $identity = $this->repository->load(new IdentityId($command->identityId));
187
188
        $identity->provePossessionOfU2fDevice(
189
            new SecondFactorId($command->secondFactorId),
190
            new U2fKeyHandle($command->keyHandle),
191
            $this->configurableSettings->createNewEmailVerificationWindow()
192
        );
193
194
        $this->repository->save($identity);
195
    }
196
197
    /**
198
     * @param VerifyEmailCommand $command