Skip to content

[10.x] Update return type - #50252

Merged
driesvints merged 1 commit into
laravel:10.xfrom
AmirRezaM75:return_type
Feb 26, 2024
Merged

[10.x] Update return type#50252
driesvints merged 1 commit into
laravel:10.xfrom
AmirRezaM75:return_type

Conversation

@AmirRezaM75

Copy link
Copy Markdown
Contributor

Update return type for getTokenForRequest method.

For example bearerToken may return null

/**
* Get the bearer token from the request headers.
*
* @return string|null
*/
public function bearerToken()

This will raise issue with phpstan when you come up with something like this:
$token = auth()->getTokenForRequest() ?? '';

@driesvints
driesvints merged commit 7786835 into laravel:10.x Feb 26, 2024
@driesvints

Copy link
Copy Markdown
Member

Thanks!

@GrahamCampbell GrahamCampbell changed the title Update return type [10.x] Update return type Feb 26, 2024
@AmirRezaM75
AmirRezaM75 deleted the return_type branch December 13, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants