Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RedirectResponse return type to Logout action #67

Closed
wants to merge 2 commits into from

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