Skip to content

[11.x] feat: add generics to Container methods #54543

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
Feb 10, 2025

Conversation

MrMeshok
Copy link
Contributor

After #51938 helpers app() and resolve() started to give nice auto completions, but if you have an instance of Application\Container your IDE still sees only mixed, for example in service providers:

$this->app->bind(MyService::class, function (Application $app) {
    app(AnotherService::class)->someMethod(); // Has auto completion
    $app->make(AnotherService::class)->someMethod(); // Doesn't have auto completion
});

This PR adds same generics to methods of Container, there applicable

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
@taylorotwell taylorotwell merged commit d0ac2bf into laravel:11.x Feb 10, 2025
44 checks passed
@MrMeshok MrMeshok deleted the container-generics branch February 10, 2025 11:07
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.

None yet

2 participants