Skip to content

[12.x] Add generic return type to Container::instance() #53161

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

Merged
merged 1 commit into from
Oct 15, 2024
Merged

[12.x] Add generic return type to Container::instance() #53161

merged 1 commit into from
Oct 15, 2024

Conversation

axlon
Copy link
Contributor

@axlon axlon commented Oct 15, 2024

This method always returns the $instance that it was given, so we can narrow the return type for editors and static analysis tools. I sent this to master instead of 11.x because changing the contract can be a breaking change

@taylorotwell taylorotwell merged commit c361cf9 into laravel:master Oct 15, 2024
31 checks passed
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