Skip to content

Commit

Permalink
[5.8] Only allow strings for resolving facade roots (laravel#25525)
Browse files Browse the repository at this point in the history
Because of laravel#25497 and laravel#25512, all facades in core are now properly
using service identifiers (strings) for resolving their "root"
service from the container. This means that the hack for resolving
objects directly can now be removed.

In case you're wondering why this is necessary: As far as I can
tell, facade features like ::swap() did not work with these types
of facades (Blade and Schema), because those methods did not deal
with the possibility of objects being returned.
  • Loading branch information
franzliedke authored and taylorotwell committed Sep 10, 2018
1 parent be4eb64 commit 466e404
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Support/Facades/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,11 @@ protected static function getFacadeAccessor()
/**
* Resolve the facade root instance from the container.
*
* @param string|object $name
* @param string $name
* @return mixed
*/
protected static function resolveFacadeInstance($name)
{
if (is_object($name)) {
return $name;
}

if (isset(static::$resolvedInstance[$name])) {
return static::$resolvedInstance[$name];
}
Expand Down

0 comments on commit 466e404

Please sign in to comment.