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
* @param string|null $assocId The SP we are logging out from.
* @return void
*/
public function startLogout(array &$state, $assocId)
public function startLogout(array &$state, ?string $assocId) : void
{
Assert::nullOrString($assocId);
$associations = $this->idp->getAssociations();
if (count($associations) === 0) {
......@@ -95,10 +93,8 @@ class IFrameLogoutHandler implements LogoutHandlerInterface
* @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any).
* @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);
$config = Configuration::getInstance();
......
......@@ -32,7 +32,7 @@ interface LogoutHandlerInterface
* @param string $assocId The association that started the logout.
* @return void
*/
public function startLogout(array &$state, $assocId);
public function startLogout(array &$state, string $assocId): void;
/**
......@@ -45,5 +45,5 @@ interface LogoutHandlerInterface
* @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any).
* @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
* @param array &$state The logout state.
* @return void
*/
private function logoutNextSP(array &$state)
private function logoutNextSP(array &$state): void
{
$association = array_pop($state['core:LogoutTraditional:Remaining']);
if ($association === null) {
......@@ -83,7 +83,7 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface
* @param string $assocId The association that started the logout.
* @return void
*/
public function startLogout(array &$state, $assocId)
public function startLogout(array &$state, string $assocId): void
{
$state['core:LogoutTraditional:Remaining'] = $this->idp->getAssociations();
......@@ -103,11 +103,8 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface
*
* @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) {
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