Skip to content

Commit

Permalink
Declare conditional return types
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed May 13, 2024
1 parent 7cd9986 commit dd4b27a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Saml2/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Saml2/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit dd4b27a

Please sign in to comment.