-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[11.11] Cannot bind an instance to a static closure #51839
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
We don't have to do all of that... You can just change this line in the factory test to declare a |
Ping @jacob418 |
Can confirm: |
Reverted. |
Laravel Version
11.11.0
PHP Version
8.3.8
Database Driver & Version
MySQL 8.0.37
Description
With a new minor release came this PR that broke factory
afterCreating()
method.Issue is happening when a closure function is declared as
static
(rector does that autmatically for us) in the factoryafterCreating()
method.See images below.
Error message:
Our code that uses this method:
Steps To Reproduce
Use a
static
clusure in factoryafterCreating()
method.The text was updated successfully, but these errors were encountered: