original_string: public function remove($metricCategory, $metricName = false)
      {
          foreach ($this->metrics as $index => $metric) {
              if ($metric->getCategoryId() === $metricCategory) {
                  if (!$metricName || $metric->getName() === $metricName) {
                      unset($this->metrics[$index]);
                      $this->metricsByNameCache = array();
                  }
              }
          }
      }
code: public function remove($metricCategory, $metricName = false)
      {
          foreach ($this->metrics as $index => $metric) {
              if ($metric->getCategoryId() === $metricCategory) {
                  if (!$metricName || $metric->getName() === $metricName) {
                      unset($this->metrics[$index]);
                      $this->metricsByNameCache = array();
                  }
              }
          }
      }
code_tokens: public function remove ( $ metricCategory , $ metricName = false ) { foreach ( $ this -> metrics as $ index => $ metric ) { if ( $ metric -> getCategoryId ( ) === $ metricCategory ) { if ( ! $ metricName || $ metric -> getName ( ) === $ metricName ) { unset ( $ this -> metrics [ $ index ] ) ; $ this -> metricsByNameCache = array ( ) ; } } } }
docstring: Removes one or more metrics from the metrics list.
  
  @param string $metricCategory The metric category id. Can be a translation token eg 'General_Visits'
  see {@link Metric::getCategory()}.
  @param string|false $metricName The name of the metric to remove eg 'nb_visits'.
  If not supplied, all metrics within that category will be removed.
docstring_tokens: Removes one or more metrics from the metrics list .