r95531 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95530‎ | r95531 | r95532 >
Date:21:45, 25 August 2011
Author:reedy
Status:deferred
Tags:
Comment:
When you override constructors, but don't pass to the parents stuff they need, things go boom and get upset
Modified paths:
  • /trunk/extensions/MetricsReporting/metrics/EditorsByGeographyMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/GenericMetricBase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/metrics/GenericMetricBase.php
@@ -11,9 +11,15 @@
1212 protected $tableName;
1313
1414 /**
 15+ * @param $query ApiBase
 16+ * @param $moduleName
 17+ * @param $paramPrefix string
1518 * @param $tableName string
 19+ * @return GenericMetricBase
 20+ *
1621 */
17 - function __construct( $tableName ) {
 22+ function __construct( ApiBase $query, $moduleName, $paramPrefix = '', $tableName ) {
 23+ parent::__construct( $query->getMain(), $moduleName, $paramPrefix );
1824 $this->tableName = $tableName;
1925 }
2026
Index: trunk/extensions/MetricsReporting/metrics/EditorsByGeographyMetric.php
@@ -7,8 +7,8 @@
88 /**
99 * @param $tableName string
1010 */
11 - function __construct() {
12 - parent::__construct( 'editorsbygeography' );
 11+ function __construct( ApiBase $query, $moduleName, $paramPrefix = '', $tableName ) {
 12+ parent::__construct( $query->getMain(), $moduleName, $paramPrefix, 'editorsbygeography' );
1313 }
1414
1515 public function getDescription() {

Status & tagging log