diff --git a/lib/SimpleSAML/Auth/State.php b/lib/SimpleSAML/Auth/State.php
index 596ce65b9e4cb70aed54690f727d1591ee8d3f0b..032d004733f5fb6536244fa3bb60375f8c862afc 100644
--- a/lib/SimpleSAML/Auth/State.php
+++ b/lib/SimpleSAML/Auth/State.php
@@ -260,6 +260,7 @@ class State
      * @throws \Exception If the stage of the state is invalid and there's no URL defined to redirect to.
      *
      * @return array|null  State information, or NULL if the state is missing and $allowMissing is true.
+     * @psalm-return ($allowMissing is true ? array|null : array)
      */
     public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
     {