r98631 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98630‎ | r98631 | r98632 >
Date:21:31, 1 October 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Add some documentation

Fix some mixed spaces/tabs

Add explicit member variables
Modified paths:
  • /trunk/extensions/Translate/Groups.php (modified) (history)
  • /trunk/extensions/Translate/scripts/list-mwext-i18n-files.php (modified) (history)
  • /trunk/extensions/Translate/scripts/yaml-tests.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialTranslationStats.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tests/MessageGroupBaseTest.php (modified) (history)
  • /trunk/extensions/Translate/tests/RubyYamlFFSTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/list-mwext-i18n-files.php
@@ -20,6 +20,12 @@
2121
2222 /// Script which lists required i18n files for MediaWiki extensions.
2323 class MWExtFileList extends Maintenance {
 24+
 25+ /**
 26+ * @var array
 27+ */
 28+ protected $files;
 29+
2430 public function __construct() {
2531 parent::__construct();
2632 $this->mDescription = 'Script which lists required i18n files for mediawiki extensions';
Index: trunk/extensions/Translate/scripts/yaml-tests.php
@@ -79,14 +79,14 @@
8080 return $groups;
8181 }
8282
83 - public static function sortNestedArrayAssoc( &$a ) {
84 - ksort( $a );
85 - foreach ( $a as $key => &$value ) {
86 - if ( is_array( $value ) ) {
87 - self::sortNestedArrayAssoc( $value );
88 - }
89 - }
90 - }
 83+ public static function sortNestedArrayAssoc( &$a ) {
 84+ ksort( $a );
 85+ foreach ( $a as &$value ) {
 86+ if ( is_array( $value ) ) {
 87+ self::sortNestedArrayAssoc( $value );
 88+ }
 89+ }
 90+ }
9191
9292 }
9393
Index: trunk/extensions/Translate/tests/MessageGroupBaseTest.php
@@ -1,6 +1,12 @@
22 <?php
33
44 class MessageGroupBaseTest extends MediaWikiTestCase {
 5+
 6+ /**
 7+ * @var MessageGroup
 8+ */
 9+ protected $group;
 10+
511 protected $groupConfiguration = array(
612 'BASIC' => array(
713 'class' => 'FileBasedMessageGroup',
@@ -14,7 +20,6 @@
1521 protected function setUp() {
1622 parent::setUp();
1723 $this->group = MessageGroupBase::factory( $this->groupConfiguration );
18 -
1924 }
2025
2126 protected function tearDown() {
Index: trunk/extensions/Translate/tests/RubyYamlFFSTest.php
@@ -1,6 +1,12 @@
22 <?php
33
44 class RubyYamlFFSTest extends MediaWikiTestCase {
 5+
 6+ /**
 7+ * @var MessageGroup
 8+ */
 9+ protected $group;
 10+
511 protected $groupConfiguration = array(
612 'BASIC' => array(
713 'class' => 'FileBasedMessageGroup',
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -63,7 +63,6 @@
6464 * Hook: PageContentLanguage
6565 */
6666 public static function onPageContentLanguage( $title, &$pageLang ) {
67 - global $wgTranslateMessageNamespaces;
6867 // For translation pages, parse plural, grammar etc with correct language, and set the right direction
6968 if ( TranslatablePage::isTranslationPage( $title ) ) {
7069 list( , $code ) = TranslateUtils::figureMessage( $title->getText() );
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php
@@ -926,7 +926,6 @@
927927 */
928928 class TranslateRegistrationStats extends TranslationStatsBase {
929929 public function preQuery( &$tables, &$fields, &$conds, &$type, &$options, $start, $end ) {
930 - $db = wfGetDB( DB_SLAVE );
931930 $tables = 'user';
932931 $fields = 'user_registration';
933932 $conds = self::makeTimeCondition( 'user_registration', $start, $end );
Index: trunk/extensions/Translate/Groups.php
@@ -135,6 +135,12 @@
136136
137137 protected function __construct() { }
138138
 139+ /**
 140+ * @static
 141+ * @param $conf
 142+ *
 143+ * @return MessageGroup
 144+ */
139145 public static function factory( $conf ) {
140146 $obj = new $conf['BASIC']['class']();
141147 $obj->conf = $conf;

Comments

#Comment by Reedy (talk | contribs)   21:31, 1 October 2011

Oh, and removed a couple of unused variables/globals

#Comment by Aaron Schulz (talk | contribs)   21:32, 1 October 2011

Maybe you could stylize & cleanup ConfirmAccount too :)

#Comment by Nikerabbit (talk | contribs)   22:01, 1 October 2011
+	 * @static

Really?

#Comment by Reedy (talk | contribs)   22:16, 1 October 2011

Rarrrgh. I try and remember to delete those

Status & tagging log