Skip to content
Snippets Groups Projects
Commit 392603a3 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fully typehint lib/IdP/*.php

parent 4b5c8217
No related branches found
No related tags found
No related merge requests found
...@@ -45,10 +45,8 @@ class IFrameLogoutHandler implements LogoutHandlerInterface ...@@ -45,10 +45,8 @@ class IFrameLogoutHandler implements LogoutHandlerInterface
* @param string|null $assocId The SP we are logging out from. * @param string|null $assocId The SP we are logging out from.
* @return void * @return void
*/ */
public function startLogout(array &$state, $assocId) public function startLogout(array &$state, ?string $assocId) : void
{ {
Assert::nullOrString($assocId);
$associations = $this->idp->getAssociations(); $associations = $this->idp->getAssociations();
if (count($associations) === 0) { if (count($associations) === 0) {
...@@ -95,10 +93,8 @@ class IFrameLogoutHandler implements LogoutHandlerInterface ...@@ -95,10 +93,8 @@ class IFrameLogoutHandler implements LogoutHandlerInterface
* @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any). * @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any).
* @return void * @return void
*/ */
public function onResponse($assocId, $relayState, Error\Exception $error = null) public function onResponse(string $assocId, ?string $relayState, Error\Exception $error = null): void
{ {
Assert::string($assocId);
$this->idp->terminateAssociation($assocId); $this->idp->terminateAssociation($assocId);
$config = Configuration::getInstance(); $config = Configuration::getInstance();
......
...@@ -32,7 +32,7 @@ interface LogoutHandlerInterface ...@@ -32,7 +32,7 @@ interface LogoutHandlerInterface
* @param string $assocId The association that started the logout. * @param string $assocId The association that started the logout.
* @return void * @return void
*/ */
public function startLogout(array &$state, $assocId); public function startLogout(array &$state, string $assocId): void;
/** /**
...@@ -45,5 +45,5 @@ interface LogoutHandlerInterface ...@@ -45,5 +45,5 @@ interface LogoutHandlerInterface
* @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any). * @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any).
* @return void * @return void
*/ */
public function onResponse($assocId, $relayState, Error\Exception $error = null); public function onResponse(string $assocId, ?string $relayState, Error\Exception $error = null): void;
} }
...@@ -46,7 +46,7 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface ...@@ -46,7 +46,7 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface
* @param array &$state The logout state. * @param array &$state The logout state.
* @return void * @return void
*/ */
private function logoutNextSP(array &$state) private function logoutNextSP(array &$state): void
{ {
$association = array_pop($state['core:LogoutTraditional:Remaining']); $association = array_pop($state['core:LogoutTraditional:Remaining']);
if ($association === null) { if ($association === null) {
...@@ -83,7 +83,7 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface ...@@ -83,7 +83,7 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface
* @param string $assocId The association that started the logout. * @param string $assocId The association that started the logout.
* @return void * @return void
*/ */
public function startLogout(array &$state, $assocId) public function startLogout(array &$state, string $assocId): void
{ {
$state['core:LogoutTraditional:Remaining'] = $this->idp->getAssociations(); $state['core:LogoutTraditional:Remaining'] = $this->idp->getAssociations();
...@@ -103,11 +103,8 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface ...@@ -103,11 +103,8 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface
* *
* @throws \SimpleSAML\Error\Exception If the RelayState was lost during logout. * @throws \SimpleSAML\Error\Exception If the RelayState was lost during logout.
*/ */
public function onResponse($assocId, $relayState, Error\Exception $error = null) public function onResponse(string $assocId, ?string $relayState, Error\Exception $error = null): void
{ {
Assert::string($assocId);
Assert::nullOrString($relayState);
if ($relayState === null) { if ($relayState === null) {
throw new Error\Exception('RelayState lost during logout.'); throw new Error\Exception('RelayState lost during logout.');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment