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

[12.x] Types: PasswordBroker::reset #55109

Merged
merged 2 commits into from
Mar 22, 2025

Conversation

liamduckett
Copy link
Contributor

Hey, this method is currently marked as returning mixed - when it actually returns string.

/**
 * Reset the password for the given token.
 *
 * @param  array  $credentials
 * @param  \Closure  $callback
 * @return mixed
 */
public function reset(#[\SensitiveParameter] array $credentials, Closure $callback)
{
    // $user is CanResetPassword|string
    $user = $this->validateReset($credentials);

    // ...

    if (! $user instanceof CanResetPasswordContract) {
        // $user is string
        return $user;
    }
    
    // ...

    // also a string
    return static::PASSWORD_RESET;
}

I haven't changed the interface, as this PasswordBroker happening to return a string doesn't necessarily (although probably does) mean they all have to.

@taylorotwell taylorotwell merged commit 1abb88a into laravel:12.x Mar 22, 2025
39 checks passed
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.

None yet

2 participants