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

Fix several Psalm-issues

parent 96357ee6
No related branches found
No related tags found
No related merge requests found
......@@ -420,7 +420,7 @@ class Module
*
* @param string $id The string we should resolve.
* @param string $type The type of the class.
* @param string|null $subclass The class should be a subclass of this class. Optional.
* @param class-string|null $subclass The class should be a subclass of this class. Optional.
*
* @return string The classname.
*
......
......@@ -262,7 +262,7 @@ class Session implements Utils\ClearableState
/**
* Retrieves the current session. Creates a new session if there's not one.
*
* @return Session The current session.
* @return \SimpleSAML\Session The current session.
* @throws \Exception When session couldn't be initialized and the session fallback is disabled by configuration.
*/
public static function getSessionFromRequest(): Session
......
......@@ -558,13 +558,15 @@ class Template extends Response
/**
* Send this template as a response.
*
* @return \Symfony\Component\HttpFoundation\Response This response.
* @return static This response.
* @throws \Exception if the template cannot be found.
*/
public function send(): static
{
$this->content = $this->getContents();
return /** @scrutinizer ignore-type */parent::send();
parent::send();
return $this;
}
......
......@@ -29,7 +29,7 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
*
* @param string $name
* @param bool $throw
* @return string|false|null
* @return string|null
*
* NOTE: cannot typehint due to upstream restrictions
*/
......
......@@ -182,6 +182,7 @@ class Signer
* @param bool $full_path Whether the filename found in the configuration contains the
* full path to the private key or not. Default to false.
* @throws \Exception
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
public function loadCertificate(string $file, bool $full_path = false): void
{
......@@ -197,11 +198,7 @@ class Signer
}
$file = new File($certFile);
$cert = $file->getContent();
if ($cert === false) {
throw new Exception('Unable to read certificate file "' . $certFile . '".');
}
$this->certificate = $cert;
$this->certificate = $file->getContent();
}
......
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