original_string: public static function getMetricsForTable(DataTable $dataTable, Report $report = null, $baseType = 'Piwik\\Plugin\\Metric')
      {
          $metrics = $dataTable->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME) ?: array();
  
          if (!empty($report)) {
              $metrics = array_merge($metrics, $report->getProcessedMetricsById());
          }
  
          $result = array();
  
          /** @var Metric $metric */
          foreach ($metrics as $metric) {
              if (!($metric instanceof $baseType)) {
                  continue;
              }
  
              $result[$metric->getName()] = $metric;
          }
  
          return $result;
      }
code: public static function getMetricsForTable(DataTable $dataTable, Report $report = null, $baseType = 'Piwik\\Plugin\\Metric')
      {
          $metrics = $dataTable->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME) ?: array();
  
          if (!empty($report)) {
              $metrics = array_merge($metrics, $report->getProcessedMetricsById());
          }
  
          $result = array();
  
          /** @var Metric $metric */
          foreach ($metrics as $metric) {
              if (!($metric instanceof $baseType)) {
                  continue;
              }
  
              $result[$metric->getName()] = $metric;
          }
  
          return $result;
      }
code_tokens: public static function getMetricsForTable ( DataTable $ dataTable , Report $ report = null , $ baseType = 'Piwik\\Plugin\\Metric' ) { $ metrics = $ dataTable -> getMetadata ( DataTable :: EXTRA_PROCESSED_METRICS_METADATA_NAME ) ? : array ( ) ; if ( ! empty ( $ report ) ) { $ metrics = array_merge ( $ metrics , $ report -> getProcessedMetricsById ( ) ) ; } $ result = array ( ) ; /** @var Metric $metric */ foreach ( $ metrics as $ metric ) { if ( ! ( $ metric instanceof $ baseType ) ) { continue ; } $ result [ $ metric -> getName ( ) ] = $ metric ; } return $ result ; }
docstring: Returns the Metrics that are displayed by a DataTable of a certain Report type.
  
  Includes ProcessedMetrics and Metrics.
  
  @param DataTable $dataTable
  @param Report|null $report
  @param string $baseType The base type each metric class needs to be of.
  @return Metric[]
  @api
docstring_tokens: Returns the Metrics that are displayed by a DataTable of a certain Report type .