http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97060
Revision: 97060 Author: reedy Date: 2011-09-14 15:07:20 +0000 (Wed, 14 Sep 2011) Log Message: ----------- Whitespace/documentation Modified Paths: -------------- trunk/extensions/Cite/Cite_body.php trunk/phase3/includes/Message.php trunk/phase3/includes/cache/MessageCache.php trunk/phase3/includes/parser/Parser.php trunk/phase3/tests/phpunit/includes/MessageTest.php Modified: trunk/extensions/Cite/Cite_body.php =================================================================== --- trunk/extensions/Cite/Cite_body.php 2011-09-14 15:06:45 UTC (rev 97059) +++ trunk/extensions/Cite/Cite_body.php 2011-09-14 15:07:20 UTC (rev 97060) @@ -71,7 +71,7 @@ * @var int */ var $mInCnt = 0; - + /** * Counter to track the total number of (useful) calls to either the * ref or references tag hook @@ -617,9 +617,9 @@ /** * Make output to be returned from the references() function - * + * * @param $group - * + * * @return string XHTML ready for output */ function referencesFormat( $group ) { @@ -1020,11 +1020,11 @@ * * @return bool */ - function clearState( $parser ) { + function clearState( &$parser ) { if ( $parser->extCite !== $this ) { return $parser->extCite->clearState( $parser ); } - + # Don't clear state when we're in the middle of parsing # a <ref> tag if ( $this->mInCite || $this->mInReferences ) { @@ -1055,7 +1055,7 @@ if ( $parser->extCite !== $this ) { return $parser->extCite->checkRefsNoReferences( $parser, $text ); } - + if ( $parser->getOptions()->getIsSectionPreview() ) { return true; } @@ -1073,13 +1073,13 @@ } return true; } - + /** * Hook for the InlineEditor extension. If any ref or reference reference tag is in the text, the entire * page should be reparsed, so we return false in that case. * * @param $output - * + * * @return bool */ function checkAnyCalls( &$output ) { @@ -1099,7 +1099,7 @@ global $wgHooks; $parser->extCite = new self(); - + if ( !Cite::$hooksInstalled ) { $wgHooks['ParserClearState'][] = array( $parser->extCite, 'clearState' ); $wgHooks['ParserBeforeTidy'][] = array( $parser->extCite, 'checkRefsNoReferences' ); Modified: trunk/phase3/includes/Message.php =================================================================== --- trunk/phase3/includes/Message.php 2011-09-14 15:06:45 UTC (rev 97059) +++ trunk/phase3/includes/Message.php 2011-09-14 15:07:20 UTC (rev 97060) @@ -11,7 +11,7 @@ * $button = Xml::button( wfMessage( 'submit' )->text() ); * </pre> * Messages can have parameters: - * wfMessage( 'welcome-to' )->params( $wgSitename )->text(); + * wfMessage( 'welcome-to' )->params( $wgSitename )->text(); * {{GRAMMAR}} and friends work correctly * wfMessage( 'are-friends', $user, $friend ); * wfMessage( 'bad-message' )->rawParams( '<script>...</script>' )->escaped(); @@ -60,7 +60,7 @@ * means the current interface language, false content language. */ protected $interface = true; - + /** * In which language to get this message. Overrides the $interface * variable. @@ -68,7 +68,7 @@ * @var Language */ protected $language = null; - + /** * The message key. */ @@ -101,6 +101,11 @@ protected $title = null; /** + * @var string + */ + protected $message; + + /** * Constructor. * @param $key: message key, or array of message keys to try and use the first non-empty message for * @param $params Array message parameters @@ -181,7 +186,7 @@ } return $this; } - + /** * Add parameters that are numeric and will be passed through * Language::formatNum before substitution @@ -198,7 +203,7 @@ } return $this; } - + /** * Request the message in any language that is supported. * As a side effect interface message status is unconditionally @@ -216,7 +221,7 @@ } else { $type = gettype( $lang ); throw new MWException( __METHOD__ . " must be " - . "passed a String or Language object; $type given" + . "passed a String or Language object; $type given" ); } $this->interface = false; @@ -268,10 +273,10 @@ */ public function toString() { $string = $this->getMessageText(); - + # Replace parameters before text parsing $string = $this->replaceParameters( $string, 'before' ); - + # Maybe transform using the full parser if( $this->format === 'parse' ) { $string = $this->parseText( $string ); @@ -287,10 +292,10 @@ $string = $this->transformText( $string ); $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false ); } - + # Raw parameter replacement $string = $this->replaceParameters( $string, 'after' ); - + return $string; } @@ -303,7 +308,7 @@ public function __toString() { return $this->toString(); } - + /** * Fully parse the text from wikitext to HTML * @return String parsed HTML Modified: trunk/phase3/includes/cache/MessageCache.php =================================================================== --- trunk/phase3/includes/cache/MessageCache.php 2011-09-14 15:06:45 UTC (rev 97059) +++ trunk/phase3/includes/cache/MessageCache.php 2011-09-14 15:07:20 UTC (rev 97060) @@ -544,6 +544,8 @@ /** * Represents a write lock on the messages key * + * @param $key string + * * @return Boolean: success */ function lock( $key ) { @@ -576,6 +578,8 @@ * fallback). * @param $isFullKey Boolean: specifies whether $key is a two part key * "msg/lang". + * + * @return string|false */ function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { global $wgLanguageCode, $wgContLang; @@ -677,6 +681,8 @@ * * @param $title String: Message cache key with initial uppercase letter. * @param $code String: code denoting the language to try. + * + * @return string|false */ function getMsgFromNamespace( $title, $code ) { global $wgAdaptiveMessageCache; @@ -795,10 +801,9 @@ /** * @param $text string - * @param $string Title|string * @param $title Title + * @param $linestart bool * @param $interface bool - * @param $linestart bool * @param $language * @return ParserOutput */ @@ -859,6 +864,10 @@ $this->mLoadedLanguages = array(); } + /** + * @param $key + * @return array + */ public function figureMessage( $key ) { global $wgLanguageCode; $pieces = explode( '/', $key ); @@ -916,6 +925,9 @@ wfProfileOut( __METHOD__ ); } + /** + * @return array + */ public function getMostUsedMessages() { wfProfileIn( __METHOD__ ); $cachekey = wfMemcKey( 'message-profiling' ); Modified: trunk/phase3/includes/parser/Parser.php =================================================================== --- trunk/phase3/includes/parser/Parser.php 2011-09-14 15:06:45 UTC (rev 97059) +++ trunk/phase3/includes/parser/Parser.php 2011-09-14 15:07:20 UTC (rev 97060) @@ -5292,7 +5292,7 @@ * not found, $mode=get will return $newtext, and $mode=replace will return $text. * * Section 0 is always considered to exist, even if it only contains the empty - * string. If $text is the empty string and section 0 is replaced, $newText is + * string. If $text is the empty string and section 0 is replaced, $newText is * returned. * * @param $mode String: one of "get" or "replace" @@ -5427,7 +5427,7 @@ /** * This function returns $oldtext after the content of the section - * specified by $section has been replaced with $text. If the target + * specified by $section has been replaced with $text. If the target * section does not exist, $oldtext is returned unchanged. * * @param $oldtext String: former text of the article Modified: trunk/phase3/tests/phpunit/includes/MessageTest.php =================================================================== --- trunk/phase3/tests/phpunit/includes/MessageTest.php 2011-09-14 15:06:45 UTC (rev 97059) +++ trunk/phase3/tests/phpunit/includes/MessageTest.php 2011-09-14 15:07:20 UTC (rev 97060) @@ -47,7 +47,7 @@ $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' ); $wgForceUIMsgAsContentMsg['testInContentLanguage'] = 'mainpage'; $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' ); - + /* Restore globals */ $wgLang = $oldLang; unset( $wgForceUIMsgAsContentMsg['testInContentLanguage'] ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs