From f215c29ab050d57131f81f6972cff9cad4df289f Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 8 Sep 2018 00:53:51 +0200 Subject: [PATCH] [5.8] Only allow strings for resolving facade roots Because of #25497 and #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. --- src/Illuminate/Support/Facades/Facade.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Illuminate/Support/Facades/Facade.php b/src/Illuminate/Support/Facades/Facade.php index 579bd7a0f015..3cfe8f7ea853 100755 --- a/src/Illuminate/Support/Facades/Facade.php +++ b/src/Illuminate/Support/Facades/Facade.php @@ -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]; }