diff --git a/modules/silauth/src/Auth/Source/tests/unit/csrf/FakeSession.php b/modules/silauth/src/Auth/Source/tests/unit/csrf/FakeSession.php index 41d1fa48..08b329e3 100644 --- a/modules/silauth/src/Auth/Source/tests/unit/csrf/FakeSession.php +++ b/modules/silauth/src/Auth/Source/tests/unit/csrf/FakeSession.php @@ -2,35 +2,32 @@ namespace SimpleSAML\Module\silauth\Auth\Source\tests\unit\csrf; +use SimpleSAML\Session; + /** * Class to mimic the bare basics of the SimpleSAML\Session class in order to * allow good testing of the CsrfProtector class. */ -class FakeSession extends \SimpleSAML\Session +class FakeSession extends Session { - private $inMemoryDataStore; + private array $inMemoryDataStore; - private function __construct($transient = false) + private function __construct(bool $transient = false) { $this->inMemoryDataStore = []; } - /** - * @param string $type - * @param string|null $id - * @return mixed - */ - public function getData($type, $id) + public function getData(string $type, ?string $id): mixed { return $this->inMemoryDataStore[$type][$id] ?? null; } - public static function getSessionFromRequest($sessionId = null) + public static function getSessionFromRequest(): Session { return new self(); } - public function setData($type, $id, $data, $timeout = null) + public function setData(string $type, string $id, mixed $data, int|string|null $timeout = null): void { // Make sure an array exists for that type of data. $this->inMemoryDataStore[$type] = $this->inMemoryDataStore[$type] ?? [];