Skip to content

Conversation

KKSzymanowski
Copy link
Contributor

@KKSzymanowski KKSzymanowski commented Feb 20, 2024

The type hint the $callback parameter in ResetPassword::toMailUsing() seems to be too narrow - it declares that the Closure must return an instance of MailMessage and nothing else. However an instance of Mailable is perfectly acceptable in this case as it goes through MailChannel::send() which has a special case for $message instanceof Mailable.

This triggers the following error eg. in phpstan:

Parameter #1 $callback of static method Illuminate\Auth\Notifications\ResetPassword::toMailUsing() expects Closure(mixed, string): Illuminate\Notifications\Messages\MailMessage, Closure(mixed, mixed): App\Mail\ResetPassword given.

I believe the type hint should be corrected to include Mailable as an acceptable Closure return type.

@KKSzymanowski KKSzymanowski force-pushed the fix-password-reset-type-hint branch from a60f590 to e2cec0b Compare February 20, 2024 16:47
@taylorotwell taylorotwell merged commit 51134d6 into laravel:10.x Feb 20, 2024
itinerare pushed a commit to itinerare/Alcyone that referenced this pull request Feb 26, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [laravel/framework](https://laravel.com) ([source](https://github.com/laravel/framework)) | require | minor | `10.44.0` -> `10.45.1` |

---

### Release Notes

<details>
<summary>laravel/framework (laravel/framework)</summary>

### [`v10.45.1`](https://github.com/laravel/framework/blob/HEAD/CHANGELOG.md#v10451---2024-02-21)

[Compare Source](laravel/framework@v10.45.0...v10.45.1)

-   Fix typehint for ResetPassword::toMailUsing() by [@&#8203;KKSzymanowski](https://github.com/KKSzymanowski) in laravel/framework#50163
-   \[10.x] Fix Process::fake() never matching multi-line commands by [@&#8203;SjorsO](https://github.com/SjorsO) in laravel/framework#50164

### [`v10.45.0`](https://github.com/laravel/framework/blob/HEAD/CHANGELOG.md#v10450---2024-02-20)

[Compare Source](laravel/framework@v10.44.0...v10.45.0)

-   \[10.x] Update `Stringable` phpdoc by [@&#8203;milwad-dev](https://github.com/milwad-dev) in laravel/framework#50075
-   \[10.x] Allow `Collection::select()` to work on `ArrayAccess` by [@&#8203;axlon](https://github.com/axlon) in laravel/framework#50072
-   \[10.x] Add `before` to the `PendingBatch` by [@&#8203;xiCO2k](https://github.com/xiCO2k) in laravel/framework#50058
-   \[10.x] Adjust rules call sequence by [@&#8203;driesvints](https://github.com/driesvints) in laravel/framework#50084
-   \[10.x] Fixes `Illuminate\Support\Str::fromBase64()` return type by [@&#8203;SamAsEnd](https://github.com/SamAsEnd) in laravel/framework#50108
-   \[10.x] Actually fix fromBase64 return type by [@&#8203;GrahamCampbell](https://github.com/GrahamCampbell) in laravel/framework#50113
-   \[10.x] Fix warning and deprecation for Str::api by [@&#8203;driesvints](https://github.com/driesvints) in laravel/framework#50114
-   \[10.x] Mark model instanse as not exists on deleting MorphPivot relation. by [@&#8203;dkulyk](https://github.com/dkulyk) in laravel/framework#50135
-   \[10.x] Adds Tappable and Conditionable to Relation class by [@&#8203;DarkGhostHunter](https://github.com/DarkGhostHunter) in laravel/framework#50124
-   \[10.x] Added getQualifiedMorphTypeName to MorphToMany by [@&#8203;dkulyk](https://github.com/dkulyk) in laravel/framework#50153

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMTQuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIxNC4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCJ9-->

Reviewed-on: https://code.itinerare.net/itinerare/Alcyone/pulls/5
Co-authored-by: Amadeus[bot] <amadeus@itinerare.net>
Co-committed-by: Amadeus[bot] <amadeus@itinerare.net>
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