diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php
index 1355d8b93dcedcefc23604d198b208de546e1ccc..23587bfa0a0064df1f1ab743fa3e899cd0cecc92 100644
--- a/lib/SimpleSAML/Configuration.php
+++ b/lib/SimpleSAML/Configuration.php
@@ -613,7 +613,7 @@ class Configuration implements Utils\ClearableState
      *                            The default value can be null or a boolean.
      *
      * @return bool|null          The option with the given name, or $default.
-     * @psalm-return              ($default is null ? null : bool)
+     * @psalm-return              ($default is set ? bool|null : bool)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not boolean.
      */
@@ -667,7 +667,7 @@ class Configuration implements Utils\ClearableState
      *                               The default value can be null or a string.
      *
      * @return string|null The option with the given name, or $default if the option isn't found.
-     * @psalm-return       ($default is null ? null : string)
+     * @psalm-return       ($default is set ? string|null : string)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not a string.
      */
@@ -721,7 +721,7 @@ class Configuration implements Utils\ClearableState
      *                         The default value can be null or an integer.
      *
      * @return int|null The option with the given name, or $default if the option isn't found.
-     * @psalm-return           ($default is null ? null : int)
+     * @psalm-return           ($default is set ? int|null : int)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not an integer.
      */
@@ -792,7 +792,7 @@ class Configuration implements Utils\ClearableState
      *
      * @return int|null The option with the given name, or $default if the option isn't found and $default is
      *     specified.
-     * @psalm-return    ($default is null ? null : int)
+     * @psalm-return    ($default is set ? int|null : int)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not in the range specified.
      */
@@ -917,7 +917,7 @@ class Configuration implements Utils\ClearableState
      *
      * @return array|null The option with the given name, or $default if the option isn't found and $default is
      * specified.
-     * @psalm-return      ($default is null ? null : array)
+     * @psalm-return      ($default is set ? array|null : array)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not an array.
      */
@@ -965,7 +965,7 @@ class Configuration implements Utils\ClearableState
      *                       The default value can be null or an array.
      *
      * @return array|null The option with the given name.
-     * @psalm-return      ($default is null ? null : array)
+     * @psalm-return      ($default is set ? array|null : array)
      */
     public function getOptionalArrayize(string $name, $default): ?array
     {
@@ -1016,7 +1016,7 @@ class Configuration implements Utils\ClearableState
      *                         The default value can be null or an array of strings.
      *
      * @return string[]|null The option with the given name, or $default if the option isn't found and $default is specified.
-     * @psalm-return         ($default is null ? null : array)
+     * @psalm-return         ($default is set ? array|null : array)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not a string or an array of strings.
      */
@@ -1074,7 +1074,7 @@ class Configuration implements Utils\ClearableState
      *
      * @return \SimpleSAML\Configuration|null The option with the given name,
      *   or $default, converted into a Configuration object.
-     * @psalm-return     ($default is null ? null : \SimpleSAML\Configuration)
+     * @psalm-return     ($default is set ? \SimpleSAML\Configuration|null : \SimpleSAML\Configuration)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException If the option is not an array.
      */
@@ -1324,7 +1324,7 @@ class Configuration implements Utils\ClearableState
      * @param mixed  $default The default value.
      *
      * @return array|null Associative array with language => string pairs, or the provided default value.
-     * @psalm-return ($default is null ? null : array)
+     * @psalm-return ($default is set ? array|null : array)
      *
      * @throws \SimpleSAML\Assert\AssertionFailedException
      *   If the translation is not an array or a string, or its index or value are not strings.