original_string: public static function setCurrentProvider($providerId)
      {
          $provider = self::getProviderById($providerId);
          if (empty($provider)) {
              throw new Exception(
                  "Invalid provider ID '$providerId'. The provider either does not exist or is not available");
          }
  
          $provider->activate();
  
          Option::set(self::CURRENT_PROVIDER_OPTION_NAME, $providerId);
          Cache::clearCacheGeneral();
          return $provider;
      }
code: public static function setCurrentProvider($providerId)
      {
          $provider = self::getProviderById($providerId);
          if (empty($provider)) {
              throw new Exception(
                  "Invalid provider ID '$providerId'. The provider either does not exist or is not available");
          }
  
          $provider->activate();
  
          Option::set(self::CURRENT_PROVIDER_OPTION_NAME, $providerId);
          Cache::clearCacheGeneral();
          return $provider;
      }
code_tokens: public static function setCurrentProvider ( $ providerId ) { $ provider = self :: getProviderById ( $ providerId ) ; if ( empty ( $ provider ) ) { throw new Exception ( "Invalid provider ID '$providerId'. The provider either does not exist or is not available" ) ; } $ provider -> activate ( ) ; Option :: set ( self :: CURRENT_PROVIDER_OPTION_NAME , $ providerId ) ; Cache :: clearCacheGeneral ( ) ; return $ provider ; }
docstring: Sets the provider to use when tracking.
  
  @param string $providerId The ID of the provider to use.
  @return \Piwik\Plugins\UserCountry\LocationProvider The new current provider.
  @throws Exception If the provider ID is invalid.
docstring_tokens: Sets the provider to use when tracking .