| Total Complexity | 5 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Session extends \flipbox\saml\core\services\Session |
||
| 14 | { |
||
| 15 | |||
| 16 | const AUTHNREQUEST_KEY = 'authnrequest.message'; |
||
| 17 | const RELAY_STATE_KEY = 'relaystate'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param AuthnRequest $message |
||
| 21 | * @return $this |
||
| 22 | */ |
||
| 23 | 2 | public function setAuthnRequest(AuthnRequest $message) |
|
| 24 | { |
||
| 25 | 2 | \Craft::$app->getSession()->set( |
|
| 26 | 2 | static::AUTHNREQUEST_KEY, |
|
| 27 | 1 | $message |
|
| 28 | ); |
||
| 29 | 2 | return $this; |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return AuthnRequest|null |
||
| 34 | */ |
||
| 35 | 2 | public function getAuthnRequest() |
|
| 36 | { |
||
| 37 | 2 | return \Craft::$app->getSession()->get( |
|
| 38 | 2 | static::AUTHNREQUEST_KEY |
|
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $relayState |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | 2 | public function setRelayState(string $relayState) |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return string|null |
||
| 57 | */ |
||
| 58 | 2 | public function getRelayState() |
|
| 59 | { |
||
| 60 | 2 | return \Craft::$app->getSession()->get( |
|
| 61 | 2 | static::RELAY_STATE_KEY |
|
| 62 | ); |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | 2 | public function remove() |
|
| 76 | ), |
||
| 77 | ]; |
||
| 78 | } |
||
| 79 | } |
||
| 80 |