laravel / jetstream

Tailwind scaffolding for the Laravel framework.
https://jetstream.laravel.com
MIT License
3.96k stars 810 forks source link

Declaration of DeleteUser::delete(User $user): void must be compatible with DeletesUsers::delete(\Illuminate\Foundation\Auth\User $user) #1512

Closed carlosmintfan closed 2 months ago

carlosmintfan commented 3 months ago

Jetstream Version

5.1

Jetstream Stack

Livewire

Laravel Version

11.9

PHP Version

8.3.8

Database Driver & Version

No response

Description

When opening app/Actions/Jetstream/DeleteUser.php in my Jetstream project, I get an error in VSCode: Declaration of DeleteUser::delete(User $user): void must be compatible with DeletesUsers::delete(\Illuminate\Foundation\Auth\User $user) Although App\Models\User extends \Illuminate\Foundation\Auth\User, that's considered incompatible. Is that correct or should I report it to my PHP plugin in VSCode? Also

Steps To Reproduce

Install a new Jetstream project – look at the Jetstream docs. Open app/Actions/Jetstream/DeleteUser.php with the PHP VSCode plugin installed. https://marketplace.visualstudio.com/items?itemName=DEVSENSE.phptools-vscode Observe the error.

At this stage, although it's a separate issue, I'd like to mention that when installing Jetstream with teams support, DB::transaction is used for deleting a user. Shouldn't that be done also in the non-team Jetstream version or is it only needed when dropping teams?

carlosmintfan commented 3 months ago

Same in all files except for CreateNewUser.php and PasswordValidationRules.php in app/Actions/Fortify

crynobone commented 2 months ago

that's considered incompatible. Is that correct or should I report it to my PHP plugin in VSCode?

This seems to be an issue with PHP plugin in VSCode.