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

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