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] Fix type nullability on PasswordBroker.events property #55097

Merged
merged 1 commit into from
Mar 22, 2025

Conversation

jnoordsij
Copy link
Contributor

@jnoordsij jnoordsij commented Mar 20, 2025

Per constructor, this property may be null:

/**
* Create a new password broker instance.
*
* @param \Illuminate\Auth\Passwords\TokenRepositoryInterface $tokens
* @param \Illuminate\Contracts\Auth\UserProvider $users
* @param \Illuminate\Contracts\Events\Dispatcher|null $dispatcher
*/
public function __construct(#[\SensitiveParameter] TokenRepositoryInterface $tokens, UserProvider $users, ?Dispatcher $dispatcher = null)
{
$this->users = $users;
$this->tokens = $tokens;
$this->events = $dispatcher;
}

It is also called in a nullsafe manner:

$this->events?->dispatch(new PasswordResetLinkSent($user));

Per constructor, this property may be null.
@taylorotwell taylorotwell merged commit dee10ca into laravel:12.x Mar 22, 2025
41 checks passed
@jnoordsij jnoordsij deleted the patch-1 branch March 22, 2025 09:01
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