http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99108
Revision: 99108 Author: reedy Date: 2011-10-06 14:26:35 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Kill weird leading semi colon from jquery.form.js More documentation stuff Modified Paths: -------------- trunk/extensions/Translate/resources/jquery.form.js trunk/extensions/Translate/specials/SpecialFirstSteps.php trunk/extensions/Translate/specials/SpecialLanguageStats.php trunk/extensions/Translate/specials/SpecialManageGroups.php trunk/extensions/Translate/specials/SpecialMessageGroupStats.php trunk/extensions/Translate/specials/SpecialMyLanguage.php trunk/extensions/Translate/specials/SpecialSupportedLanguages.php trunk/extensions/Translate/specials/SpecialTranslate.php trunk/extensions/Translate/specials/SpecialTranslationStats.php trunk/extensions/Translate/tag/RenderJob.php trunk/extensions/Translate/tag/SpecialPageTranslation.php trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php trunk/extensions/Translate/tag/TranslatablePage.php trunk/extensions/Translate/utils/Html.php trunk/phase3/includes/Cdb.php Modified: trunk/extensions/Translate/resources/jquery.form.js =================================================================== --- trunk/extensions/Translate/resources/jquery.form.js 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/resources/jquery.form.js 2011-10-06 14:26:35 UTC (rev 99108) @@ -8,7 +8,7 @@ * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ -;(function($) { +(function($) { /* Usage Note: Modified: trunk/extensions/Translate/specials/SpecialFirstSteps.php =================================================================== --- trunk/extensions/Translate/specials/SpecialFirstSteps.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialFirstSteps.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -16,8 +16,22 @@ * @ingroup SpecialPage TranslateSpecialPage */ class SpecialFirstSteps extends UnlistedSpecialPage { - protected $skin, $user, $out; + /** + * @var Skin + */ + protected $skin; + + /** + * @var User + */ + protected $user; + + /** + * @var OutputPage + */ + protected $out; + public function __construct() { parent::__construct( 'FirstSteps' ); } Modified: trunk/extensions/Translate/specials/SpecialLanguageStats.php =================================================================== --- trunk/extensions/Translate/specials/SpecialLanguageStats.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialLanguageStats.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -21,10 +21,15 @@ * @ingroup SpecialPage TranslateSpecialPage Stats */ class SpecialLanguageStats extends IncludableSpecialPage { - /// @var StatsTable + + /** + * @var StatsTable + */ protected $table; - /// @var String + /** + * @var String + */ protected $targetValueName = 'code'; /** @@ -68,6 +73,11 @@ */ protected $target; + /** + * @var bool + */ + protected $purge; + public function __construct() { parent::__construct( 'LanguageStats' ); global $wgLang; @@ -257,6 +267,12 @@ /// } } + /** + * @param $item + * @param $cache + * @param $parent string + * @return string + */ protected function makeGroupGroup( $item, $cache, $parent = '' ) { if ( !is_array( $item ) ) { return $this->makeGroupRow( $item, $cache, $parent === '' ? false : $parent ); @@ -272,9 +288,15 @@ return $out; } + /** + * @param $group + * @param $cache + * @param $parent bool + * @return string + */ protected function makeGroupRow( $group, $cache, $parent = false ) { if ( $this->table->isBlacklisted( $group->getId(), $this->target ) !== null ) { - return; + return ''; } $stats = $cache[$group->getId()]; Modified: trunk/extensions/Translate/specials/SpecialManageGroups.php =================================================================== --- trunk/extensions/Translate/specials/SpecialManageGroups.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialManageGroups.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -18,7 +18,21 @@ * messages, as well as import/update of messages in other languages. */ class SpecialManageGroups extends SpecialPage { - protected $skin, $user, $out; + /** + * @var Skin + */ + protected $skin; + + /** + * @var User + */ + protected $user; + + /** + * @var OutputPage + */ + protected $out; + /// Maximum allowed processing time in seconds. protected $processingTime = 30; @@ -139,6 +153,12 @@ $wgOut->addHTML( '</ul>' ); } + /** + * @param $group MessageGroup + * @param $codes + * @param $from + * @return string + */ protected function rebuildButton( $group, $codes, $from ) { $formParams = array( 'method' => 'post', @@ -160,6 +180,8 @@ /** * @todo Very long code block; split up. + * + * @param $group MessageGroup */ public function importForm( $group, $code ) { $this->setSubtitle( $group, $code ); @@ -388,6 +410,9 @@ } } + /** + * @param $group MessageGroup + */ public function doModLangs( $group ) { global $wgLang; Modified: trunk/extensions/Translate/specials/SpecialMessageGroupStats.php =================================================================== --- trunk/extensions/Translate/specials/SpecialMessageGroupStats.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialMessageGroupStats.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -30,7 +30,7 @@ public function getDescription() { return wfMessage( 'translate-mgs-pagename' )->text(); } - + /// Overwritten from SpecialLanguageStats protected function getAllowedValues() { $groups = MessageGroups::getAllGroups(); @@ -109,7 +109,11 @@ return $out; } - /// Overwriten from SpecialLanguageStats + /** + * Overwriten from SpecialLanguageStats + * + * @return string + */ function getTable() { $table = $this->table; $out = ''; @@ -144,6 +148,11 @@ } } + /** + * @param $code + * @param $cache + * @return string + */ protected function makeRow( $code, $cache ) { $stats = $cache[$code]; @@ -175,6 +184,11 @@ return $out; } + /** + * @param $code + * @param $params + * @return string + */ protected function getMainColumnCell( $code, $params ) { if ( !isset( $this->names ) ) { global $wgLang; Modified: trunk/extensions/Translate/specials/SpecialMyLanguage.php =================================================================== --- trunk/extensions/Translate/specials/SpecialMyLanguage.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialMyLanguage.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -49,7 +49,7 @@ * Make Special:MyLanguage links red if the target page doesn't exists. * A bit hacky because the core code is not so flexible. * @param $dummy - * @param $target + * @param $target Title * @param $html * @param $customAttribs * @param $query Modified: trunk/extensions/Translate/specials/SpecialSupportedLanguages.php =================================================================== --- trunk/extensions/Translate/specials/SpecialSupportedLanguages.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialSupportedLanguages.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -245,7 +245,6 @@ return $users; } - protected function outputLanguageCloud( $names ) { global $wgOut; Modified: trunk/extensions/Translate/specials/SpecialTranslate.php =================================================================== --- trunk/extensions/Translate/specials/SpecialTranslate.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialTranslate.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -16,7 +16,15 @@ * @ingroup SpecialPage TranslateSpecialPage */ class SpecialTranslate extends SpecialPage { + + /** + * @var Task + */ protected $task = null; + + /** + * @var MessageGroup + */ protected $group = null; protected $defaults = null; @@ -222,6 +230,12 @@ return $form; } + /** + * @param $label + * @param $option + * @param $error null + * @return string + */ private static function optionRow( $label, $option, $error = null ) { return Xml::openElement( 'tr' ) . @@ -229,7 +243,6 @@ Xml::tags( 'td', null, $option ) . ( $error ? Xml::tags( 'td', array( 'class' => 'mw-sp-translate-error' ), $error ) : '' ) . Xml::closeElement( 'tr' ); - } /* Selectors ahead */ Modified: trunk/extensions/Translate/specials/SpecialTranslationStats.php =================================================================== --- trunk/extensions/Translate/specials/SpecialTranslationStats.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/specials/SpecialTranslationStats.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -183,9 +183,10 @@ /** * Constructs a table row with label and input in two columns. - * @param $name \string Option name. + * @param $name string Option name. * @param $opts FormOptions - * @return \string Html. + * @param $width int + * @return string Html. */ protected function eInput( $name, FormOptions $opts, $width = 4 ) { $value = $opts[$name]; @@ -301,7 +302,7 @@ /** * Constructs a JavaScript enhanced group selector. - * @return \type{JsSelectToInput} + * @return JsSelectToInput */ protected function groupSelector() { $groups = MessageGroups::singleton()->getGroups(); @@ -497,6 +498,12 @@ return $cutoff; } + /** + * @param $ts + * @param $amount + * @param $dir + * @return int + */ protected static function roundingAddition( $ts, $amount, $dir ) { if ( $dir === -1 ) { return -1 * ( $ts % $amount ); Modified: trunk/extensions/Translate/tag/RenderJob.php =================================================================== --- trunk/extensions/Translate/tag/RenderJob.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/tag/RenderJob.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -93,7 +93,7 @@ } /** - * @param $user User + * @param $user User|string */ public function setUser( $user ) { if ( $user instanceof User ) { Modified: trunk/extensions/Translate/tag/SpecialPageTranslation.php =================================================================== --- trunk/extensions/Translate/tag/SpecialPageTranslation.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/tag/SpecialPageTranslation.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -53,7 +53,6 @@ // Check permissions if ( !$this->user->isAllowed( 'pagetranslation' ) ) { $wgOut->permissionRequired( 'pagetranslation' ); - return; } @@ -252,6 +251,12 @@ } } + /** + * @param $title Title + * @param $rev + * @param $latest + * @param string $old + */ protected function actionLinks( $title, $rev, $latest, $old = 'old' ) { $actions = array(); @@ -351,7 +356,11 @@ return $sections; } - /** Displays the sections and changes for the user to review */ + /** + * Displays the sections and changes for the user to review + * @param $page TranslatablePage + * @param $sections array + */ public function showPage( TranslatablePage $page, Array $sections ) { global $wgOut, $wgContLang; @@ -548,6 +557,10 @@ return false; } + /** + * @param $page Article + * @param $changed + */ public function addFuzzyTags( $page, $changed ) { if ( !count( $changed ) ) { self::superDebug( __METHOD__, 'nochanged', $page->getTitle() ); @@ -613,6 +626,8 @@ * If this page is marked for the first time, /en may not yet exists. * If this is the case, add a RenderJob for it, but don't execute it * immediately, since the message group doesn't exist during this request. + * @param $page Article + * @param $titles array */ protected function addInitialRenderJob( $page, $titles ) { global $wgContLang; Modified: trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php =================================================================== --- trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -33,8 +33,9 @@ /// Allow skipping non-translation subpages. protected $doSubpages = false; - - /// TranslatablePage instance. + /** + * @var TranslatablePage + */ protected $page; /// Contains the language code if we are working with translation page protected $code; @@ -262,6 +263,10 @@ $wgOut->addHTML( implode( "\n", $form ) ); } + /** + * @param $title Title + * @param $enabled bool + */ protected function printChangeLine( $title, $enabled = true ) { global $wgOut; if ( $enabled ) { @@ -361,6 +366,9 @@ return $this->title->getSubpages(); } + /** + * @return bool + */ protected function singleLanguage() { return $this->code !== ''; } Modified: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php =================================================================== --- trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -47,7 +47,7 @@ /** - * TranslatablePage instance. + * @var TranslatablePage instance. */ protected $page; @@ -324,6 +324,12 @@ $wgOut->addHTML( implode( "\n", $form ) ); } + /** + * @param $base + * @param $old Title + * @param $target + * @param bool $enabled + */ protected function printChangeLine( $base, $old, $target, $enabled = true ) { global $wgOut; Modified: trunk/extensions/Translate/tag/TranslatablePage.php =================================================================== --- trunk/extensions/Translate/tag/TranslatablePage.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/tag/TranslatablePage.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -25,6 +25,8 @@ /** * Revision of the page, if applicaple. + * + * @var int */ protected $revision = null; @@ -183,7 +185,7 @@ /** * Returns MessageGroup used for translating this page. It may still be empty * if the page has not been ever marked. - * @return \type{WikiPageMessageGroup} + * @return WikiPageMessageGroup */ public function getMessageGroup() { return MessageGroups::getGroup( $this->getMessageGroupId() ); @@ -297,6 +299,11 @@ // Inner functionality // + /** + * @param $holders + * @param $text + * @return mixed + */ public static function armourNowiki( &$holders, $text ) { $re = '~(<nowiki>)(.*?)(</nowiki>)~s'; @@ -309,6 +316,11 @@ return $text; } + /** + * @param $holders + * @param $text + * @return mixed + */ public static function unArmourNowiki( $holders, $text ) { foreach ( $holders as $ph => $value ) { $text = str_replace( $ph, $value, $text ); @@ -500,7 +512,11 @@ unset( self::$tagCache[$aid] ); } - /// @return false if tag is not found + /** + * @param $tag + * @param $dbt int + * @return array|bool false if tag is not found + */ protected function getTag( $tag, $dbt = DB_SLAVE ) { if ( !$this->getTitle()->exists() ) { return false; @@ -530,6 +546,10 @@ } } + /** + * @param $code bool|string + * @return String + */ public function getTranslationUrl( $code = false ) { $translate = SpecialPage::getTitleFor( 'Translate' ); $params = array( @@ -628,6 +648,11 @@ return $temp; } + /** + * @param $collection MessageCollection + * @param $markedRevs + * @return float|int + */ protected function getPercentageInternal( $collection, $markedRevs ) { $count = count( $collection ); if ( $count === 0 ) { @@ -687,6 +712,10 @@ return $db->selectField( 'revtag', $fields, $conds, __METHOD__, $options ); } + /** + * @param $title Title + * @return bool|TranslatablePage + */ public static function isTranslationPage( Title $title ) { list( $key, $code ) = TranslateUtils::figureMessage( $title->getText() ); @@ -721,6 +750,10 @@ return Title::makeTitleSafe( $title->getNamespace(), $text ); } + /** + * @param $title Title + * @return bool + */ public static function isSourcePage( Title $title ) { static $cache = null; Modified: trunk/extensions/Translate/utils/Html.php =================================================================== --- trunk/extensions/Translate/utils/Html.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/extensions/Translate/utils/Html.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -59,7 +59,7 @@ * Sets the tag content. Chain-accessor. * * @param $value \mixed Optional. Null to view and string to set the content. - * @return \mixed The content as a string or self. + * @return HtmlTag|string The content as a string or self. */ public function content( $value = null ) { if ( $value === null ) { @@ -120,7 +120,7 @@ * * @param $name \string The name of the parameter. * @param $value \mixed Optional. False to unset, null to view and string to set the value. - * @return \mixed The value of the parameter or null if not set. + * @return null|HtmlTag The value of the parameter or null if not set. */ public function style( $name, $value = null ) { $name = (string) $this->assert( 'is_string', $name ); Modified: trunk/phase3/includes/Cdb.php =================================================================== --- trunk/phase3/includes/Cdb.php 2011-10-06 14:09:53 UTC (rev 99107) +++ trunk/phase3/includes/Cdb.php 2011-10-06 14:26:35 UTC (rev 99108) @@ -72,7 +72,7 @@ * * @param $fileName string * - * @return bool + * @return CdbWriter_DBA|CdbWriter_PHP */ public static function open( $fileName ) { if ( CdbReader::haveExtension() ) { _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs