original_string: public static function getNumUsableCustomVariables()
      {
          $cache    = Cache::getCacheGeneral();
          $cacheKey = self::MAX_NUM_CUSTOMVARS_CACHEKEY;
  
          if (!array_key_exists($cacheKey, $cache)) {
  
              $minCustomVar = null;
  
              foreach (Model::getScopes() as $scope) {
                  $model = new Model($scope);
                  $highestIndex = $model->getHighestCustomVarIndex();
  
                  if (!isset($minCustomVar)) {
                      $minCustomVar = $highestIndex;
                  }
  
                  if ($highestIndex < $minCustomVar) {
                      $minCustomVar = $highestIndex;
                  }
              }
  
              if (!isset($minCustomVar)) {
                  $minCustomVar = 0;
              }
  
              $cache[$cacheKey] = $minCustomVar;
              Cache::setCacheGeneral($cache);
          }
  
          return $cache[$cacheKey];
      }
code: public static function getNumUsableCustomVariables()
      {
          $cache    = Cache::getCacheGeneral();
          $cacheKey = self::MAX_NUM_CUSTOMVARS_CACHEKEY;
  
          if (!array_key_exists($cacheKey, $cache)) {
  
              $minCustomVar = null;
  
              foreach (Model::getScopes() as $scope) {
                  $model = new Model($scope);
                  $highestIndex = $model->getHighestCustomVarIndex();
  
                  if (!isset($minCustomVar)) {
                      $minCustomVar = $highestIndex;
                  }
  
                  if ($highestIndex < $minCustomVar) {
                      $minCustomVar = $highestIndex;
                  }
              }
  
              if (!isset($minCustomVar)) {
                  $minCustomVar = 0;
              }
  
              $cache[$cacheKey] = $minCustomVar;
              Cache::setCacheGeneral($cache);
          }
  
          return $cache[$cacheKey];
      }
code_tokens: public static function getNumUsableCustomVariables ( ) { $ cache = Cache :: getCacheGeneral ( ) ; $ cacheKey = self :: MAX_NUM_CUSTOMVARS_CACHEKEY ; if ( ! array_key_exists ( $ cacheKey , $ cache ) ) { $ minCustomVar = null ; foreach ( Model :: getScopes ( ) as $ scope ) { $ model = new Model ( $ scope ) ; $ highestIndex = $ model -> getHighestCustomVarIndex ( ) ; if ( ! isset ( $ minCustomVar ) ) { $ minCustomVar = $ highestIndex ; } if ( $ highestIndex < $ minCustomVar ) { $ minCustomVar = $ highestIndex ; } } if ( ! isset ( $ minCustomVar ) ) { $ minCustomVar = 0 ; } $ cache [ $ cacheKey ] = $ minCustomVar ; Cache :: setCacheGeneral ( $ cache ) ; } return $ cache [ $ cacheKey ] ; }
docstring: Returns the number of available custom variables that can be used.
  
  "Can be used" is identifed by the minimum number of available custom variables across all relevant tables. Eg
  if there are 6 custom variables installed in log_visit but only 5 in log_conversion, we consider only 5 custom
  variables as usable.
  @return int
docstring_tokens: Returns the number of available custom variables that can be used .