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

[5.4] Adjust app() to work with the new container changes #17060

Merged
merged 1 commit into from
Dec 31, 2016
Merged
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
14 changes: 6 additions & 8 deletions src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,16 @@ function action($name, $parameters = [], $absolute = true)
/**
* Get the available container instance.
*
* @param string $make
* @param array $parameters
* @param string $abstract
* @return mixed|\Illuminate\Foundation\Application
*/
function app($make = null, $parameters = [])
function app($abstract = null)
{
if (is_null($make)) {
if (is_null($abstract)) {
return Container::getInstance();
}

return Container::getInstance()->make($make, $parameters);
return Container::getInstance()->make($abstract);
}
}

Expand Down Expand Up @@ -636,12 +635,11 @@ function request($key = null, $default = null)
* Resolve a service from the container.
*
* @param string $name
* @param array $parameters
* @return mixed
*/
function resolve($name, $parameters = [])
function resolve($name)
{
return app($name, $parameters);
return app($name);
}
}

Expand Down