@@ -33,7 +33,7 @@ class OAuthServerException extends Exception
3333 /**
3434 * Throw a new exception.
3535 */
36- final public function __construct (string $ message , int $ code , private string $ errorType , private int $ httpStatusCode = 400 , private ?string $ hint = null , private ?string $ redirectUri = null , Throwable $ previous = null )
36+ final public function __construct (string $ message , int $ code , private string $ errorType , private int $ httpStatusCode = 400 , private ?string $ hint = null , private ?string $ redirectUri = null , ? Throwable $ previous = null )
3737 {
3838 parent ::__construct ($ message , $ code , $ previous );
3939 $ this ->payload = [
@@ -88,7 +88,7 @@ public static function unsupportedGrantType(): static
8888 /**
8989 * Invalid request error.
9090 */
91- public static function invalidRequest (string $ parameter , ?string $ hint = null , Throwable $ previous = null ): static
91+ public static function invalidRequest (string $ parameter , ?string $ hint = null , ? Throwable $ previous = null ): static
9292 {
9393 $ errorMessage = 'The request is missing a required parameter, includes an invalid parameter value, ' .
9494 'includes a parameter more than once, or is otherwise malformed. ' ;
@@ -141,7 +141,7 @@ public static function invalidCredentials(): static
141141 *
142142 * @codeCoverageIgnore
143143 */
144- public static function serverError (string $ hint , Throwable $ previous = null ): static
144+ public static function serverError (string $ hint , ? Throwable $ previous = null ): static
145145 {
146146 return new static (
147147 'The authorization server encountered an unexpected condition which prevented it from fulfilling '
@@ -158,15 +158,15 @@ public static function serverError(string $hint, Throwable $previous = null): st
158158 /**
159159 * Invalid refresh token.
160160 */
161- public static function invalidRefreshToken (?string $ hint = null , Throwable $ previous = null ): static
161+ public static function invalidRefreshToken (?string $ hint = null , ? Throwable $ previous = null ): static
162162 {
163163 return new static ('The refresh token is invalid. ' , 8 , 'invalid_grant ' , 400 , $ hint , null , $ previous );
164164 }
165165
166166 /**
167167 * Access denied.
168168 */
169- public static function accessDenied (?string $ hint = null , ?string $ redirectUri = null , Throwable $ previous = null ): static
169+ public static function accessDenied (?string $ hint = null , ?string $ redirectUri = null , ? Throwable $ previous = null ): static
170170 {
171171 return new static (
172172 'The resource owner or authorization server denied the request. ' ,
@@ -207,15 +207,15 @@ public function getErrorType(): string
207207 *
208208 * @return static
209209 */
210- public static function expiredToken (?string $ hint = null , Throwable $ previous = null ): static
210+ public static function expiredToken (?string $ hint = null , ? Throwable $ previous = null ): static
211211 {
212212 $ errorMessage = 'The `device_code` has expired and the device ' .
213213 'authorization session has concluded. ' ;
214214
215215 return new static ($ errorMessage , 11 , 'expired_token ' , 400 , $ hint , null , $ previous );
216216 }
217217
218- public static function authorizationPending (string $ hint = '' , Throwable $ previous = null ): static
218+ public static function authorizationPending (string $ hint = '' , ? Throwable $ previous = null ): static
219219 {
220220 return new static (
221221 'The authorization request is still pending as the end user ' .
@@ -236,7 +236,7 @@ public static function authorizationPending(string $hint = '', Throwable $previo
236236 *
237237 * @return static
238238 */
239- public static function slowDown (string $ hint = '' , Throwable $ previous = null ): static
239+ public static function slowDown (string $ hint = '' , ? Throwable $ previous = null ): static
240240 {
241241 return new static (
242242 'The authorization request is still pending and polling should ' .
0 commit comments