Skip to content
Snippets Groups Projects
Commit 750403d9 authored by Tim van Dijen's avatar Tim van Dijen Committed by Tim van Dijen
Browse files

Fix Psalm-issues in IdP.php

parent 87f1aca2
No related branches found
No related tags found
No related merge requests found
...@@ -40,9 +40,9 @@ class IdP ...@@ -40,9 +40,9 @@ class IdP
* We use this to support cross-protocol logout until * We use this to support cross-protocol logout until
* we implement a cross-protocol IdP. * we implement a cross-protocol IdP.
* *
* @var string|null * @var string
*/ */
private $associationGroup = null; private $associationGroup;
/** /**
* The configuration for this IdP. * The configuration for this IdP.
...@@ -98,7 +98,7 @@ class IdP ...@@ -98,7 +98,7 @@ class IdP
// probably no SAML 2 IdP configured for this host. Ignore the error // probably no SAML 2 IdP configured for this host. Ignore the error
} }
} else { } else {
assert(false); throw new \Exception("Protocol not implemented.");
} }
if ($this->associationGroup === null) { if ($this->associationGroup === null) {
...@@ -435,7 +435,6 @@ class IdP ...@@ -435,7 +435,6 @@ class IdP
* Find the logout handler of this IdP. * Find the logout handler of this IdP.
* *
* @return IdP\LogoutHandlerInterface The logout handler class. * @return IdP\LogoutHandlerInterface The logout handler class.
*
* @throws Exception If we cannot find a logout handler. * @throws Exception If we cannot find a logout handler.
*/ */
public function getLogoutHandler() public function getLogoutHandler()
...@@ -453,6 +452,7 @@ class IdP ...@@ -453,6 +452,7 @@ class IdP
throw new Error\Exception('Unknown logout handler: '.var_export($logouttype, true)); throw new Error\Exception('Unknown logout handler: '.var_export($logouttype, true));
} }
/** @var IdP\LogoutHandlerInterface */
return new $handler($this); return new $handler($this);
} }
...@@ -505,8 +505,10 @@ class IdP ...@@ -505,8 +505,10 @@ class IdP
$this->authSource->logout($returnTo); $this->authSource->logout($returnTo);
$handler = $this->getLogoutHandler(); if ($assocId !== null) {
$handler->startLogout($state, $assocId); $handler = $this->getLogoutHandler();
$handler->startLogout($state, $assocId);
}
assert(false); assert(false);
} }
...@@ -526,8 +528,11 @@ class IdP ...@@ -526,8 +528,11 @@ class IdP
assert(is_string($assocId)); assert(is_string($assocId));
assert(is_string($relayState) || $relayState === null); assert(is_string($relayState) || $relayState === null);
$index = strpos($assocId, ':');
assert(is_int($index));
$session = Session::getSessionFromRequest(); $session = Session::getSessionFromRequest();
$session->deleteData('core:idp-ssotime', $this->id.';'.substr($assocId, strpos($assocId, ':') + 1)); $session->deleteData('core:idp-ssotime', $this->id.';'.substr($assocId, $index + 1));
$handler = $this->getLogoutHandler(); $handler = $this->getLogoutHandler();
$handler->onResponse($assocId, $relayState, $error); $handler->onResponse($assocId, $relayState, $error);
......
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