Skip to content
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

[10.x] Add typehints to app and resolve helpers for better resolution from container #48286

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@
if (! function_exists('app')) {
/**
* Get the available container instance.
*
* @template TAbstract
*
* @param string|null $abstract
* @param string|class-string<TAbstract>|null $abstract
* @param array $parameters
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|mixed
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|TAbstract|mixed
*/
function app($abstract = null, array $parameters = [])

Check failure on line 116 in src/Illuminate/Foundation/helpers.php

View workflow job for this annotation

GitHub Actions / Source Code

Template type TAbstract of function app() is not referenced in a parameter.
{
if (is_null($abstract)) {
return Container::getInstance();
Expand Down Expand Up @@ -752,12 +754,14 @@
if (! function_exists('resolve')) {
/**
* Resolve a service from the container.
*
* @template TAbstract
*
* @param string $name
* @param string|class-string<TAbstract> $name
* @param array $parameters
* @return mixed
* @return TAbstract|mixed
*/
function resolve($name, array $parameters = [])

Check failure on line 764 in src/Illuminate/Foundation/helpers.php

View workflow job for this annotation

GitHub Actions / Source Code

Template type TAbstract of function resolve() is not referenced in a parameter.
{
return app($name, $parameters);
}
Expand Down
Loading