diff --git a/src/Saml2/Auth.php b/src/Saml2/Auth.php index 63fb5b54..f4dfdbb5 100644 --- a/src/Saml2/Auth.php +++ b/src/Saml2/Auth.php @@ -220,6 +220,7 @@ public function setSchemasPath($path) * Process the SAML Response sent by the IdP. * * @param string|null $requestId The ID of the AuthNRequest sent by this SP to the IdP + * @phpstan-return ($stay is true ? string : never) * * @throws Error * @throws ValidationError @@ -270,6 +271,7 @@ public function processResponse($requestId = null) * @param bool $stay True if we want to stay (returns the url string) False to redirect * * @return string|null + * @phpstan-return ($stay is true ? string : never) * * @throws Error */ @@ -352,6 +354,7 @@ public function processSLO($keepLocalSession = false, $requestId = null, $retrie * @param bool $stay True if we want to stay (returns the url string) False to redirect * * @return string|null + * @phpstan-return ($stay is true ? string : never) */ public function redirectTo($url = '', array $parameters = array(), $stay = false) { @@ -533,6 +536,7 @@ public function getAttributeWithFriendlyName($friendlyName) * @param string $nameIdValueReq Indicates to the IdP the subject that should be authenticated * * @return string|null If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters + * @phpstan-return ($stay is true ? string : never) * * @throws Error */ @@ -573,6 +577,7 @@ public function login($returnTo = null, array $parameters = array(), $forceAuthn * @param string|null $nameIdNameQualifier The NameID NameQualifier will be set in the LogoutRequest. * * @return string|null If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters + * @phpstan-return ($stay is true ? string : never) * * @throws Error */ diff --git a/src/Saml2/Utils.php b/src/Saml2/Utils.php index 517ff50f..cb9def98 100644 --- a/src/Saml2/Utils.php +++ b/src/Saml2/Utils.php @@ -310,6 +310,7 @@ public static function getStringBetween($str, $start, $end) * @param bool $stay True if we want to stay (returns the url string) False to redirect * * @return string|null $url + * @phpstan-return ($stay is true ? string : never) * * @throws Error */ @@ -916,6 +917,7 @@ public static function parseDuration($duration, $timestamp = null) * @param string|int|null $validUntil The valid until date, as a string or as a timestamp * * @return int|null $expireTime The expiration time. + * @phpstan-return ($cacheDuration is true ? string : never) * * @throws Exception */