original_string: protected function createClient(array $config)
      {
          return tap(new Redis, function ($client) use ($config) {
              $this->establishConnection($client, $config);
  
              if (! empty($config['password'])) {
                  $client->auth($config['password']);
              }
  
              if (! empty($config['database'])) {
                  $client->select($config['database']);
              }
  
              if (! empty($config['prefix'])) {
                  $client->setOption(Redis::OPT_PREFIX, $config['prefix']);
              }
  
              if (! empty($config['read_timeout'])) {
                  $client->setOption(Redis::OPT_READ_TIMEOUT, $config['read_timeout']);
              }
          });
      }
code: protected function createClient(array $config)
      {
          return tap(new Redis, function ($client) use ($config) {
              $this->establishConnection($client, $config);
  
              if (! empty($config['password'])) {
                  $client->auth($config['password']);
              }
  
              if (! empty($config['database'])) {
                  $client->select($config['database']);
              }
  
              if (! empty($config['prefix'])) {
                  $client->setOption(Redis::OPT_PREFIX, $config['prefix']);
              }
  
              if (! empty($config['read_timeout'])) {
                  $client->setOption(Redis::OPT_READ_TIMEOUT, $config['read_timeout']);
              }
          });
      }
code_tokens: protected function createClient ( array $ config ) { return tap ( new Redis , function ( $ client ) use ( $ config ) { $ this -> establishConnection ( $ client , $ config ) ; if ( ! empty ( $ config [ 'password' ] ) ) { $ client -> auth ( $ config [ 'password' ] ) ; } if ( ! empty ( $ config [ 'database' ] ) ) { $ client -> select ( $ config [ 'database' ] ) ; } if ( ! empty ( $ config [ 'prefix' ] ) ) { $ client -> setOption ( Redis :: OPT_PREFIX , $ config [ 'prefix' ] ) ; } if ( ! empty ( $ config [ 'read_timeout' ] ) ) { $ client -> setOption ( Redis :: OPT_READ_TIMEOUT , $ config [ 'read_timeout' ] ) ; } } ) ; }
docstring: Create the Redis client instance.
  
  @param  array  $config
  @return \Redis
docstring_tokens: Create the Redis client instance .