r83665 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83664‎ | r83665 | r83666 >
Date:20:24, 10 March 2011
Author:hashar
Status:ok
Tags:
Comment:
Makes MediaWikiProvide methods static

Follow up and revert r82369 which used dynamic calls
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/Providers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/Providers.php
@@ -11,7 +11,7 @@
1212 class MediaWikiProvide {
1313
1414 /* provide an array of numbers from 1 up to @param $num */
15 - private function createProviderUpTo( $num ) {
 15+ private static function createProviderUpTo( $num ) {
1616 $ret = array();
1717 for( $i=1; $i<=$num;$i++ ) {
1818 $ret[] = array( $i );
@@ -20,20 +20,20 @@
2121 }
2222
2323 /* array of months numbers (as an integer) */
24 - public function Months() {
25 - return $this->createProviderUpTo( 12 );
 24+ public static function Months() {
 25+ return self::createProviderUpTo( 12 );
2626 }
2727
2828 /* array of days numbers (as an integer) */
29 - public function Days() {
30 - return $this->createProviderUpTo( 31 );
 29+ public static function Days() {
 30+ return self::createProviderUpTo( 31 );
3131 }
3232
33 - public function DaysMonths() {
 33+ public static function DaysMonths() {
3434 $ret = array();
3535
36 - $months = $this->Months();
37 - $days = $this->Days();
 36+ $months = self::Months();
 37+ $days = self::Days();
3838 foreach( $months as $month) {
3939 foreach( $days as $day ) {
4040 $ret[] = array( $day[0], $month[0] );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82369Fix wrong static callsreedy01:00, 18 February 2011

Status & tagging log