Code Duplication    Length = 4-4 lines in 8 locations

src/Surfnet/StepupRa/RaBundle/Controller/Vetting/U2fController.php 2 locations

@@ 47-50 (lines=4) @@
44
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
45
        $logger->notice('Suggesting RA start U2F authentication');
46
47
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
48
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
49
            throw $this->createNotFoundException(sprintf('Vetting procedure "%s" not found', $procedureId));
50
        }
51
52
        return ['procedureId' => $procedureId];
53
    }
@@ 70-73 (lines=4) @@
67
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
68
        $logger->notice('Requested U2F Verfication');
69
70
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
71
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
72
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
73
        }
74
75
        $service = $this->getVettingService();
76
        $session = $this->get('ra.session.u2f');

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

@@ 46-49 (lines=4) @@
43
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
44
        $logger->notice('Requested Yubikey Verfication');
45
46
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
47
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
48
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
49
        }
50
51
        $command = new VerifyYubikeyPublicIdCommand();
52
        $form = $this->createForm('ra_verify_yubikey_public_id', $command)->handleRequest($request);

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

@@ 50-53 (lines=4) @@
47
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
48
        $logger->notice('Received request for Send SMS Challenge page');
49
50
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
51
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
52
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
53
        }
54
55
        $command = new SendSmsChallengeCommand();
56
        $form = $this->createForm('ra_send_sms_challenge', $command)->handleRequest($request);

src/Surfnet/StepupRa/RaBundle/Controller/Vetting/GssfController.php 2 locations

@@ 56-59 (lines=4) @@
53
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
54
        $logger->notice('Showing Initiate GSSF Verification Screen', ['provider' => $provider]);
55
56
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
57
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
58
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
59
        }
60
61
        return $this->renderInitiateForm($procedureId, $this->getProvider($provider)->getName());
62
    }
@@ 78-81 (lines=4) @@
75
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
76
        $logger->notice('Generating GSSF verification request', ['provider' => $provider]);
77
78
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
79
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
80
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
81
        }
82
83
        $provider = $this->getProvider($provider);
84

src/Surfnet/StepupRa/RaBundle/Controller/VettingController.php 2 locations

@@ 139-142 (lines=4) @@
136
    {
137
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
138
139
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
140
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
141
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
142
        }
143
144
        $this->getVettingService()->cancelProcedure($procedureId);
145
        $this->addFlash('info', $this->get('translator')->trans('ra.vetting.flash.cancelled'));
@@ 163-166 (lines=4) @@
160
        $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId);
161
        $logger->notice('Verify Identity Form requested');
162
163
        if (!$this->getVettingService()->hasProcedure($procedureId)) {
164
            $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId));
165
            throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId));
166
        }
167
168
        $command = new VerifyIdentityCommand();
169
        $form = $this->createForm('ra_verify_identity', $command)->handleRequest($request);