Ejemplo n.º 1
0
 /**
  * Create a new driver instance.
  *
  * @param  string  $driverName
  *
  * @return object
  */
 protected function createDriver($driverName)
 {
     list($driver, $name) = $this->getDriverName($driverName);
     $method = 'create' . Str::studly($driver) . 'Driver';
     // We'll check to see if a creator method exists for the given driver.
     // If not we will check for a custom driver creator, which allows
     // developers to create drivers using their own customized driver
     // creator Closure to create it.
     if (isset($this->customCreators[$driver])) {
         return $this->callCustomCreator($driverName);
     } elseif (method_exists($this, $method)) {
         return call_user_func([$this, $method], $name);
     }
     throw new InvalidArgumentException("Driver [{$driver}] not supported.");
 }