Code Duplication    Length = 9-9 lines in 2 locations

src/Surfnet/StepupGateway/SamlStepupProviderBundle/Controller/SamlProxyController.php 1 location

@@ 196-204 (lines=9) @@
193
194
        $adaptedAssertion = new AssertionAdapter($assertion);
195
        $expectedResponse = $stateHandler->getGatewayRequestId();
196
        if (!$adaptedAssertion->inResponseToMatches($expectedResponse)) {
197
            $logger->critical(sprintf(
198
                'Received Response with unexpected InResponseTo: "%s", %s',
199
                $adaptedAssertion->getInResponseTo(),
200
                ($expectedResponse ? 'expected "' . $expectedResponse . '"' : ' no response expected')
201
            ));
202
203
            return $this->render('unrecoverableError');
204
        }
205
206
        $authenticatedNameId = $assertion->getNameId();
207
        $isSubjectRequested = $stateHandler->hasSubject();

src/Surfnet/StepupGateway/GatewayBundle/Controller/GatewayController.php 1 location

@@ 137-145 (lines=9) @@
134
135
        $adaptedAssertion = new AssertionAdapter($assertion);
136
        $expectedInResponseTo = $responseContext->getExpectedInResponseTo();
137
        if (!$adaptedAssertion->inResponseToMatches($expectedInResponseTo)) {
138
            $logger->critical(sprintf(
139
                'Received Response with unexpected InResponseTo: "%s", %s',
140
                $adaptedAssertion->getInResponseTo(),
141
                ($expectedInResponseTo ? 'expected "' . $expectedInResponseTo . '"' : ' no response expected')
142
            ));
143
144
            return $this->render('unrecoverableError');
145
        }
146
147
        $logger->notice('Successfully processed SAMLResponse');
148