http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98631

Revision: 98631
Author:   reedy
Date:     2011-10-01 21:31:11 +0000 (Sat, 01 Oct 2011)
Log Message:
-----------
Add some documentation

Fix some mixed spaces/tabs

Add explicit member variables

Modified Paths:
--------------
    trunk/extensions/Translate/Groups.php
    trunk/extensions/Translate/scripts/list-mwext-i18n-files.php
    trunk/extensions/Translate/scripts/yaml-tests.php
    trunk/extensions/Translate/specials/SpecialTranslationStats.php
    trunk/extensions/Translate/tag/PageTranslationHooks.php
    trunk/extensions/Translate/tests/MessageGroupBaseTest.php
    trunk/extensions/Translate/tests/RubyYamlFFSTest.php

Modified: trunk/extensions/Translate/Groups.php
===================================================================
--- trunk/extensions/Translate/Groups.php       2011-10-01 21:28:00 UTC (rev 
98630)
+++ trunk/extensions/Translate/Groups.php       2011-10-01 21:31:11 UTC (rev 
98631)
@@ -135,6 +135,12 @@
 
        protected function __construct() { }
 
+       /**
+        * @static
+        * @param $conf
+        *
+        * @return MessageGroup
+        */
        public static function factory( $conf ) {
                $obj = new $conf['BASIC']['class']();
                $obj->conf =  $conf;

Modified: trunk/extensions/Translate/scripts/list-mwext-i18n-files.php
===================================================================
--- trunk/extensions/Translate/scripts/list-mwext-i18n-files.php        
2011-10-01 21:28:00 UTC (rev 98630)
+++ trunk/extensions/Translate/scripts/list-mwext-i18n-files.php        
2011-10-01 21:31:11 UTC (rev 98631)
@@ -20,6 +20,12 @@
 
 /// Script which lists required i18n files for MediaWiki extensions.
 class MWExtFileList extends Maintenance {
+
+       /**
+        * @var array
+        */
+       protected $files;
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = 'Script which lists required i18n files 
for mediawiki extensions';

Modified: trunk/extensions/Translate/scripts/yaml-tests.php
===================================================================
--- trunk/extensions/Translate/scripts/yaml-tests.php   2011-10-01 21:28:00 UTC 
(rev 98630)
+++ trunk/extensions/Translate/scripts/yaml-tests.php   2011-10-01 21:31:11 UTC 
(rev 98631)
@@ -79,14 +79,14 @@
                return $groups;
        }
 
-  public static function sortNestedArrayAssoc( &$a ) {
-    ksort( $a );
-    foreach ( $a as $key => &$value ) {
-      if ( is_array( $value ) ) {
-        self::sortNestedArrayAssoc( $value );
-      }
-    }
-  }
+       public static function sortNestedArrayAssoc( &$a ) {
+               ksort( $a );
+               foreach ( $a as &$value ) {
+                       if ( is_array( $value ) ) {
+                               self::sortNestedArrayAssoc( $value );
+                       }
+               }
+       }
 
 }
 

Modified: trunk/extensions/Translate/specials/SpecialTranslationStats.php
===================================================================
--- trunk/extensions/Translate/specials/SpecialTranslationStats.php     
2011-10-01 21:28:00 UTC (rev 98630)
+++ trunk/extensions/Translate/specials/SpecialTranslationStats.php     
2011-10-01 21:31:11 UTC (rev 98631)
@@ -926,7 +926,6 @@
  */
 class TranslateRegistrationStats extends TranslationStatsBase {
        public function preQuery( &$tables, &$fields, &$conds, &$type, 
&$options, $start, $end ) {
-               $db = wfGetDB( DB_SLAVE );
                $tables = 'user';
                $fields = 'user_registration';
                $conds = self::makeTimeCondition( 'user_registration', $start, 
$end );

Modified: trunk/extensions/Translate/tag/PageTranslationHooks.php
===================================================================
--- trunk/extensions/Translate/tag/PageTranslationHooks.php     2011-10-01 
21:28:00 UTC (rev 98630)
+++ trunk/extensions/Translate/tag/PageTranslationHooks.php     2011-10-01 
21:31:11 UTC (rev 98631)
@@ -63,7 +63,6 @@
         * Hook: PageContentLanguage
         */
        public static function onPageContentLanguage( $title, &$pageLang ) {
-               global $wgTranslateMessageNamespaces;
                // For translation pages, parse plural, grammar etc with 
correct language, and set the right direction
                if ( TranslatablePage::isTranslationPage( $title ) ) {
                        list( , $code ) = TranslateUtils::figureMessage( 
$title->getText() );

Modified: trunk/extensions/Translate/tests/MessageGroupBaseTest.php
===================================================================
--- trunk/extensions/Translate/tests/MessageGroupBaseTest.php   2011-10-01 
21:28:00 UTC (rev 98630)
+++ trunk/extensions/Translate/tests/MessageGroupBaseTest.php   2011-10-01 
21:31:11 UTC (rev 98631)
@@ -1,6 +1,12 @@
 <?php
 
 class MessageGroupBaseTest extends MediaWikiTestCase {
+
+       /**
+        * @var MessageGroup
+        */
+       protected $group;
+
        protected $groupConfiguration = array(
                'BASIC' => array(
                        'class' => 'FileBasedMessageGroup',
@@ -14,7 +20,6 @@
        protected function setUp() {
                parent::setUp();
                $this->group = MessageGroupBase::factory( 
$this->groupConfiguration );
-
        }
 
        protected function tearDown() {

Modified: trunk/extensions/Translate/tests/RubyYamlFFSTest.php
===================================================================
--- trunk/extensions/Translate/tests/RubyYamlFFSTest.php        2011-10-01 
21:28:00 UTC (rev 98630)
+++ trunk/extensions/Translate/tests/RubyYamlFFSTest.php        2011-10-01 
21:31:11 UTC (rev 98631)
@@ -1,6 +1,12 @@
 <?php
 
 class RubyYamlFFSTest extends MediaWikiTestCase {
+
+       /**
+        * @var MessageGroup
+        */
+       protected $group;
+
        protected $groupConfiguration = array(
                'BASIC' => array(
                        'class' => 'FileBasedMessageGroup',


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to