From 5430f448b7b325ba07d85b22c558d86f865c9837 Mon Sep 17 00:00:00 2001 From: Kalpa Perera Date: Sat, 13 May 2017 23:23:49 +0530 Subject: [PATCH] Removed unwanted else --- src/Illuminate/Support/Manager.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index 592776c2c859..0a420c1a708e 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -81,13 +81,14 @@ protected function createDriver($driver) // drivers using their own customized driver creator Closure to create it. if (isset($this->customCreators[$driver])) { return $this->callCustomCreator($driver); - } else { - $method = 'create'.Str::studly($driver).'Driver'; + } + + $method = 'create'.Str::studly($driver).'Driver'; - if (method_exists($this, $method)) { - return $this->$method(); - } + if (method_exists($this, $method)) { + return $this->$method(); } + throw new InvalidArgumentException("Driver [$driver] not supported."); }