r108788 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108787‎ | r108788 | r108789 >
Date:02:40, 13 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Partial revert ContextSource changes from r108785, r108786
Modified paths:
  • /trunk/phase3/includes/Preferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Preferences.php
@@ -38,10 +38,10 @@
3939 /**
4040 * @throws MWException
4141 * @param $user User
42 - * @param $context ContextSource
 42+ * @param $context IContextSource
4343 * @return array|null
4444 */
45 - public static function getPreferences( $user, ContextSource $context ) {
 45+ static function getPreferences( $user, IContextSource $context ) {
4646 if ( self::$defaultPreferences ) {
4747 return self::$defaultPreferences;
4848 }
@@ -127,11 +127,11 @@
128128
129129 /**
130130 * @param $user User
131 - * @param $context ContextSource
 131+ * @param $context IContextSource
132132 * @param $defaultPreferences
133133 * @return void
134134 */
135 - static function profilePreferences( $user, ContextSource $context, &$defaultPreferences ) {
 135+ static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
136136 global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode,
137137 $wgDisableTitleConversion, $wgDisableLangConversion, $wgMaxSigChars,
138138 $wgEnableEmail, $wgEmailConfirmToEdit, $wgEnableUserEmail, $wgEmailAuthentication,
@@ -454,11 +454,11 @@
455455
456456 /**
457457 * @param $user User
458 - * @param $context ContextSource
 458+ * @param $context IContextSource
459459 * @param $defaultPreferences
460460 * @return void
461461 */
462 - static function skinPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 462+ static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
463463 ## Skin #####################################
464464 global $wgAllowUserCss, $wgAllowUserJs;
465465
@@ -509,10 +509,10 @@
510510
511511 /**
512512 * @param $user User
513 - * @param $context ContextSource
 513+ * @param $context IContextSource
514514 * @param $defaultPreferences Array
515515 */
516 - static function filesPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 516+ static function filesPreferences( $user, IContextSource $context, &$defaultPreferences ) {
517517 ## Files #####################################
518518 $defaultPreferences['imagesize'] = array(
519519 'type' => 'select',
@@ -530,11 +530,11 @@
531531
532532 /**
533533 * @param $user User
534 - * @param $context ContextSource
 534+ * @param $context IContextSource
535535 * @param $defaultPreferences
536536 * @return void
537537 */
538 - static function datetimePreferences( $user, ContextSource $context, &$defaultPreferences ) {
 538+ static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) {
539539 ## Date and time #####################################
540540 $dateOptions = self::getDateOptions( $context );
541541 if ( $dateOptions ) {
@@ -603,10 +603,10 @@
604604
605605 /**
606606 * @param $user User
607 - * @param $context ContextSource
 607+ * @param $context IContextSource
608608 * @param $defaultPreferences Array
609609 */
610 - static function renderingPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 610+ static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
611611 ## Page Rendering ##############################
612612 global $wgAllowUserCssPrefs;
613613 if ( $wgAllowUserCssPrefs ) {
@@ -681,10 +681,10 @@
682682
683683 /**
684684 * @param $user User
685 - * @param $context ContextSource
 685+ * @param $context IContextSource
686686 * @param $defaultPreferences Array
687687 */
688 - static function editingPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 688+ static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
689689 global $wgUseExternalEditor, $wgAllowUserCssPrefs;
690690
691691 ## Editing #####################################
@@ -781,10 +781,10 @@
782782
783783 /**
784784 * @param $user User
785 - * @param $context ContextSource
 785+ * @param $context IContextSource
786786 * @param $defaultPreferences Array
787787 */
788 - static function rcPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 788+ static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) {
789789 global $wgRCMaxAge, $wgRCShowWatchingUsers;
790790
791791 ## RecentChanges #####################################
@@ -838,10 +838,10 @@
839839
840840 /**
841841 * @param $user User
842 - * @param $context ContextSource
 842+ * @param $context IContextSource
843843 * @param $defaultPreferences
844844 */
845 - static function watchlistPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 845+ static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
846846 global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge;
847847
848848 $watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) );
@@ -939,10 +939,10 @@
940940
941941 /**
942942 * @param $user User
943 - * @param $context ContextSource
 943+ * @param $context IContextSource
944944 * @param $defaultPreferences Array
945945 */
946 - static function searchPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 946+ static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
947947 global $wgContLang, $wgEnableMWSuggest, $wgVectorUseSimpleSearch;
948948
949949 ## Search #####################################
@@ -1003,10 +1003,10 @@
10041004
10051005 /**
10061006 * @param $user User
1007 - * @param $context ContextSource
 1007+ * @param $context IContextSource
10081008 * @param $defaultPreferences Array
10091009 */
1010 - static function miscPreferences( $user, ContextSource $context, &$defaultPreferences ) {
 1010+ static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
10111011 global $wgContLang;
10121012
10131013 ## Misc #####################################
@@ -1035,10 +1035,10 @@
10361036
10371037 /**
10381038 * @param $user User The User object
1039 - * @param $context ContextSource
 1039+ * @param $context IContextSource
10401040 * @return Array: text/links to display as key; $skinkey as value
10411041 */
1042 - static function generateSkinOptions( $user, ContextSource $context ) {
 1042+ static function generateSkinOptions( $user, IContextSource $context ) {
10431043 global $wgDefaultSkin, $wgAllowUserCss, $wgAllowUserJs;
10441044 $ret = array();
10451045
@@ -1090,10 +1090,10 @@
10911091 }
10921092
10931093 /**
1094 - * @param $context ContextSource
 1094+ * @param $context IContextSource
10951095 * @return array
10961096 */
1097 - static function getDateOptions( ContextSource $context ) {
 1097+ static function getDateOptions( IContextSource $context ) {
10981098 $lang = $context->getLanguage();
10991099 $dateopts = $lang->getDatePreferences();
11001100
@@ -1125,10 +1125,10 @@
11261126 }
11271127
11281128 /**
1129 - * @param $context ContextSource
 1129+ * @param $context IContextSource
11301130 * @return array
11311131 */
1132 - static function getImageSizes( ContextSource $context ) {
 1132+ static function getImageSizes( IContextSource $context ) {
11331133 global $wgImageLimits;
11341134
11351135 $ret = array();
@@ -1143,10 +1143,10 @@
11441144 }
11451145
11461146 /**
1147 - * @param $context ContextSource
 1147+ * @param $context IContextSource
11481148 * @return array
11491149 */
1150 - static function getThumbSizes( ContextSource $context ) {
 1150+ static function getThumbSizes( IContextSource $context ) {
11511151 global $wgThumbLimits;
11521152
11531153 $ret = array();
@@ -1200,12 +1200,12 @@
12011201
12021202 /**
12031203 * @param $user User
1204 - * @param $context ContextSource
 1204+ * @param $context IContextSource
12051205 * @param $formClass string
12061206 * @param $remove Array: array of items to remove
12071207 * @return HtmlForm
12081208 */
1209 - static function getFormObject( $user, ContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
 1209+ static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
12101210 $formDescriptor = Preferences::getPreferences( $user, $context );
12111211 if ( count( $remove ) ) {
12121212 $removeKeys = array_flip( $remove );
@@ -1229,10 +1229,9 @@
12301230 }
12311231
12321232 /**
1233 - * @param $context ContextSource
12341233 * @return array
12351234 */
1236 - static function getTimezoneOptions( ContextSource $context ) {
 1235+ static function getTimezoneOptions( IContextSource $context ) {
12371236 $opt = array();
12381237
12391238 global $wgLocalTZoffset, $wgLocaltimezone;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108785Documentation...reedy02:27, 13 January 2012
r108786A couple more for r108785...reedy02:30, 13 January 2012

Status & tagging log