original_string: public function driver($driver = '', array $configs = [])
      {
          $driverList = $this->defaultDriverList;
          if (isset($driverList[$driver])) {
              $driver = $driverList[$driver];
              $driver = new $driver($configs);
  
              if ($driver instanceof DriverInterface) {
                  return $driver;
              } else {
                  throw new DriverException(sprintf('your %s driver has not Driver Interface', get_class($driver)));
              }
          } else {
              throw new DriverNotInstalledException(sprintf('your %s driver is not installed', $driver));
          }
  
      }
code: public function driver($driver = '', array $configs = [])
      {
          $driverList = $this->defaultDriverList;
          if (isset($driverList[$driver])) {
              $driver = $driverList[$driver];
              $driver = new $driver($configs);
  
              if ($driver instanceof DriverInterface) {
                  return $driver;
              } else {
                  throw new DriverException(sprintf('your %s driver has not Driver Interface', get_class($driver)));
              }
          } else {
              throw new DriverNotInstalledException(sprintf('your %s driver is not installed', $driver));
          }
  
      }
code_tokens: public function driver ( $ driver = '' , array $ configs = [ ] ) { $ driverList = $ this -> defaultDriverList ; if ( isset ( $ driverList [ $ driver ] ) ) { $ driver = $ driverList [ $ driver ] ; $ driver = new $ driver ( $ configs ) ; if ( $ driver instanceof DriverInterface ) { return $ driver ; } else { throw new DriverException ( sprintf ( 'your %s driver has not Driver Interface' , get_class ( $ driver ) ) ) ; } } else { throw new DriverNotInstalledException ( sprintf ( 'your %s driver is not installed' , $ driver ) ) ; } }
docstring: select a driver
  
  @param string $driver the name of driver
  @param array $configs the configs for driver
  @throws DriverException
  @throws DriverNotInstalledException
  @return DriverInterface if driver name isset in driver list, return the driver instance, else return false
docstring_tokens: select a driver