Code Duplication    Length = 5-7 lines in 2 locations

src/Surfnet/StepupRa/RaBundle/Controller/Vetting/SmsController.php 1 location

@@ 127-133 (lines=7) @@
124
            return $this->redirectToRoute('ra_vetting_search');
125
        }
126
127
        if (!$form->isSubmitted() || !$form->isValid()) {
128
            $logger->notice(
129
                'SMS OTP was not submitted through form, rendering Proof of Possession of SMS Second Factor page'
130
            );
131
132
            return ['form' => $form->createView()];
133
        }
134
135
        $logger->notice('SMS OTP has been entered, attempting to verify Proof of Possession');
136
        $verification = $this->getVettingService()->verifyPhoneNumber($procedureId, $command);

src/Surfnet/StepupRa/RaBundle/Controller/VettingController.php 1 location

@@ 66-70 (lines=5) @@
63
64
        $form = $this->createForm(StartVettingProcedureType::class, $command)->handleRequest($request);
65
66
        if (!$form->isSubmitted() || !$form->isValid()) {
67
            $logger->notice('No search submitted, displaying search by registration code form');
68
69
            return ['form' => $form->createView()];
70
        }
71
72
        $secondFactor = $this->getSecondFactorService()
73
            ->findVerifiedSecondFactorByRegistrationCode($command->registrationCode, $identity->id);