diff --git a/src/Illuminate/Support/MultipleInstanceManager.php b/src/Illuminate/Support/MultipleInstanceManager.php index 8544bdf71b34..575e37d2dadd 100644 --- a/src/Illuminate/Support/MultipleInstanceManager.php +++ b/src/Illuminate/Support/MultipleInstanceManager.php @@ -64,7 +64,7 @@ abstract public function setDefaultInstance($name); abstract public function getInstanceConfig($name); /** - * Get an instance instance by name. + * Get an instance by name. * * @param string|null $name * @return mixed @@ -94,6 +94,7 @@ protected function get($name) * @return mixed * * @throws \InvalidArgumentException + * @throws \RuntimeException */ protected function resolve($name) { @@ -109,15 +110,15 @@ protected function resolve($name) if (isset($this->customCreators[$config['driver']])) { return $this->callCustomCreator($config); - } else { - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; + } - if (method_exists($this, $driverMethod)) { - return $this->{$driverMethod}($config); - } else { - throw new InvalidArgumentException("Instance driver [{$config['driver']}] is not supported."); - } + $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; + + if (method_exists($this, $driverMethod)) { + return $this->{$driverMethod}($config); } + + throw new InvalidArgumentException("Instance driver [{$config['driver']}] is not supported."); } /**