Skip to content

Conversation

@dommer1
Copy link

@dommer1 dommer1 commented Mar 19, 2025

This pull request adds the correct return type declaration to the Logout action's __invoke() method. The method needs a union type of RedirectResponse|Redirector to properly type-hint the return value of the redirect() helper function.

I found that using only RedirectResponse or only Redirector as the return type wasn't sufficient to satisfy both tests and static analysis. The Laravel redirect() helper can return either type depending on the context. This union type solution ensures correct type checking while maintaining compatibility with Laravel's actual behavior.

@tnylea
Copy link
Contributor

tnylea commented Mar 31, 2025

Looks good 👍

@tnylea tnylea added the Approved Approved for Merge label Mar 31, 2025
@taylorotwell
Copy link
Member

This method never actually returns a redirector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved for Merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants