original_string: protected function createClient($dsn, array $config, array $options)
      {
          // By default driver options is an empty array.
          $driverOptions = [];
  
          if (isset($config['driver_options']) && is_array($config['driver_options'])) {
              $driverOptions = $config['driver_options'];
          }
  
          // Check if the credentials are not already set in the options
          if (!isset($options['username']) && !empty($config['username'])) {
              $options['username'] = $config['username'];
          }
          if (!isset($options['password']) && !empty($config['password'])) {
              $options['password'] = $config['password'];
          }
  
          return new Client($dsn, $options, $driverOptions);
      }
code: protected function createClient($dsn, array $config, array $options)
      {
          // By default driver options is an empty array.
          $driverOptions = [];
  
          if (isset($config['driver_options']) && is_array($config['driver_options'])) {
              $driverOptions = $config['driver_options'];
          }
  
          // Check if the credentials are not already set in the options
          if (!isset($options['username']) && !empty($config['username'])) {
              $options['username'] = $config['username'];
          }
          if (!isset($options['password']) && !empty($config['password'])) {
              $options['password'] = $config['password'];
          }
  
          return new Client($dsn, $options, $driverOptions);
      }
code_tokens: protected function createClient ( $ dsn , array $ config , array $ options ) { // By default driver options is an empty array. $ driverOptions = [ ] ; if ( isset ( $ config [ 'driver_options' ] ) && is_array ( $ config [ 'driver_options' ] ) ) { $ driverOptions = $ config [ 'driver_options' ] ; } // Check if the credentials are not already set in the options if ( ! isset ( $ options [ 'username' ] ) && ! empty ( $ config [ 'username' ] ) ) { $ options [ 'username' ] = $ config [ 'username' ] ; } if ( ! isset ( $ options [ 'password' ] ) && ! empty ( $ config [ 'password' ] ) ) { $ options [ 'password' ] = $ config [ 'password' ] ; } return new Client ( $ dsn , $ options , $ driverOptions ) ; }
docstring: Create a new MongoDB client connection.
  
  @param  string $dsn
  @param  array $config
  @param  array $options
  @return Client
docstring_tokens: Create a new MongoDB client connection .