r91194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91193‎ | r91194 | r91195 >
Date:18:24, 30 June 2011
Author:reedy
Status:deferred
Tags:
Comment:
Fix parameter types, set proper param name
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalytics.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php
@@ -31,7 +31,7 @@
3232
3333 protected function getExamples() {
3434 return array(
35 - 'api.php?action=analytics&metric=',
 35+ 'api.php?action=analytics&metric=comscoreuniquevisitors',
3636 );
3737 }
3838
Index: trunk/extensions/MetricsReporting/ApiAnalytics.php
@@ -16,7 +16,7 @@
1717 global $wgMetricAPIModules;
1818 // Instantiate requested modules
1919 $modules = array();
20 - $this->instantiateModules( $modules, 'prop', $wgMetricAPIModules );
 20+ $this->instantiateModules( $modules, 'metric', $wgMetricAPIModules );
2121
2222 // Execute all requested modules.
2323 foreach ( $modules as $module ) {
@@ -41,11 +41,10 @@
4242 }
4343
4444 public function getAllowedParams() {
45 - global $wgMetricAPIModules;
4645 return array(
4746 'metric' => array(
4847 ApiBase::PARAM_ISMULTI => false,
49 - ApiBase::PARAM_TYPE => $wgMetricAPIModules,
 48+ ApiBase::PARAM_TYPE => $this->metricModuleNames,
5049 ApiBase::PARAM_REQUIRED => true,
5150 ),
5251 );

Status & tagging log