-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
afterCreating method does not accept Closure(Model) #1131
Comments
Hello Сергей! 👋 Thank you for your report. |
Yes If you return the |
Thank you! |
No. We need generics! /**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Data\Models\Task>
*/
class TaskFactory extends Factory
{ But I cannot get it working. |
What information can I provide you? To understand where the bug crept in? Thank you. Generic did not help. |
@canvural Can you help us? We are a bit lost. |
Hello, The types are coming from Laravel itself. So I suggest opening an issue there. A solution would be to change the type here to just Also instead of an issue you can directly create a PR there. Feel free to link this issue or this comment. Thanks. |
@canvural It looks like Laravel won't be making that change in the near future, as the delay is IDE support (laravel/framework#41286). Is this something which Larastan can support in the meantime? |
@mdpoulter Yeah, I guess we can do that. It should be added to this stub file. |
--level
used: 8Description
Every time I call afterMaking or afterCreating phpstan crashes with an error.
Laravel code where the issue was found
The text was updated successfully, but these errors were encountered: