Skip to content

Commit

Permalink
[5.4] Adjust app() to work with the new container changes (#17060)
Browse files Browse the repository at this point in the history
  • Loading branch information
KennedyTedesco authored and taylorotwell committed Dec 31, 2016
1 parent 9725a8e commit d7d15f8
Showing 1 changed file with 6 additions and 8 deletions.
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

0 comments on commit d7d15f8

Please sign in to comment.