Conditions | 4 |
Paths | 10 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function acsAction(Request $request) |
||
|
|||
22 | { |
||
23 | libxml_disable_entity_loader(true); |
||
24 | try { |
||
25 | $httpPostBinding = new HTTPPost(); |
||
26 | $message = $httpPostBinding->receive(); |
||
27 | } catch (\Exception $e1) { |
||
28 | try { |
||
29 | $httpRedirectBinding = new HTTPRedirect(); |
||
30 | $message = $httpRedirectBinding->receive(); |
||
31 | } catch (\Exception $e2) { |
||
32 | throw new \RuntimeException('Unable to retrieve SAML message?', 1, $e1); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | if (!$message instanceof SAMLResponse) { |
||
37 | throw new \RuntimeException(sprintf('Unrecognized message type received: "%s"', get_class($message))); |
||
38 | } |
||
39 | |||
40 | $xml = base64_decode($request->get('SAMLResponse')); |
||
41 | return XMLResponse::create($xml); |
||
42 | } |
||
43 | |||
45 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.