r90026 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90025‎ | r90026 | r90027 >
Date:01:56, 14 June 2011
Author:demon
Status:ok
Tags:
Comment:
* Remove @static from the last few places it's left in core. Please don't use this silly annotation anymore, that's what the static keyword is for.
* Enforce protected on SpecialAllPages::getNamespaceKeyAndText(), it's not @private like the comment implies
* Drop User::getMaxID(), nothing uses it
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php
@@ -668,7 +668,6 @@
669669 *
670670 * @param $text String: the text to tidy
671671 * @return String
672 - * @static
673672 */
674673 protected function tidy( $text ) {
675674 global $wgUseTidy;
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -1205,7 +1205,6 @@
12061206 *
12071207 * @param $text String: the text to tidy
12081208 * @return String
1209 - * @static
12101209 */
12111210 private function tidy( $text ) {
12121211 global $wgUseTidy;
Index: trunk/phase3/includes/User.php
@@ -2864,22 +2864,6 @@
28652865 }
28662866
28672867 /**
2868 - * Get the maximum valid user ID.
2869 - * @return Integer: User ID
2870 - * @static
2871 - */
2872 - function getMaxID() {
2873 - static $res; // cache
2874 -
2875 - if ( isset( $res ) ) {
2876 - return $res;
2877 - } else {
2878 - $dbr = wfGetDB( DB_SLAVE );
2879 - return $res = $dbr->selectField( 'user', 'max(user_id)', false, __METHOD__ );
2880 - }
2881 - }
2882 -
2883 - /**
28842868 * Determine whether the user is a newbie. Newbies are either
28852869 * anonymous IPs, or the most recently created accounts.
28862870 * @return Bool
Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -468,10 +468,8 @@
469469 * @param $ns Integer: the namespace of the article
470470 * @param $text String: the name of the article
471471 * @return array( int namespace, string dbkey, string pagename ) or NULL on error
472 - * @static (sort of)
473 - * @access private
474472 */
475 - function getNamespaceKeyAndText($ns, $text) {
 473+ protected function getNamespaceKeyAndText($ns, $text) {
476474 if ( $text == '' )
477475 return array( $ns, '', '' ); # shortcut for common case
478476

Status & tagging log