Code Duplication    Length = 3-4 lines in 2 locations

src/Surfnet/StepupGateway/GatewayBundle/Controller/SecondFactorController.php 2 locations

@@ 379-382 (lines=4) @@
376
        $form = $this->createForm(VerifyYubikeyOtpType::class, $command)->handleRequest($request);
377
        $cancelForm = $this->buildCancelAuthenticationForm($authenticationMode)->handleRequest($request);
378
379
        if ($form->isSubmitted() && !$form->isValid()) {
380
            // OTP field is rendered empty in the template.
381
            return ['form' => $form->createView(), 'cancelForm' => $cancelForm->createView()];
382
        }
383
384
        $result = $this->getStepupService()->verifyYubikeyOtp($command);
385
@@ 506-508 (lines=3) @@
503
        $form = $this->createForm(VerifySmsChallengeType::class, $command)->handleRequest($request);
504
        $cancelForm = $this->buildCancelAuthenticationForm($authenticationMode)->handleRequest($request);
505
506
        if ($form->isSubmitted() && !$form->isValid()) {
507
            return ['form' => $form->createView(), 'cancelForm' => $cancelForm->createView()];
508
        }
509
510
        $logger->notice('Verifying input SMS challenge matches');
511