r110083 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110082‎ | r110083 | r110084 >
Date:21:04, 26 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Fix/add documentation

Fix whitespace
Modified paths:
  • /trunk/extensions/ConditionalShowSection/ConditionalShowSection.php (modified) (history)
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php (modified) (history)
  • /trunk/extensions/NewestPages/NewestPages.page.php (modified) (history)
  • /trunk/extensions/wikihiero/wikihiero.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewestPages/NewestPages.page.php
@@ -24,8 +24,6 @@
2525 public function execute( $par ) {
2626 global $wgRequest, $wgOut, $wgContLang, $wgLang;
2727
28 -
29 -
3028 # Decipher input passed to the page
3129 $this->decipherParams( $par );
3230 $this->setOptions( $wgRequest );
Index: trunk/extensions/ConditionalShowSection/ConditionalShowSection.php
@@ -34,11 +34,21 @@
3535
3636 $wgHooks['ParserFirstCallInit'][] = 'wfConditionalShowSection';
3737
 38+/**
 39+ * @param $parser Parser
 40+ * @return bool
 41+ */
3842 function wfConditionalShowSection( $parser ) {
39 - $parser->setHook( "cshow", "ConditionalShowSection" );
40 - return true;
 43+ $parser->setHook( "cshow", "ConditionalShowSection" );
 44+ return true;
4145 }
4246
 47+/**
 48+ * @param $input
 49+ * @param $argv
 50+ * @param $parser Parser
 51+ * @return string
 52+ */
4353 function ConditionalShowSection( $input, $argv, &$parser ) {
4454 #
4555 # By default, the section is HIDDEN unless the following conditions are met:
@@ -63,7 +73,6 @@
6474 global $wgUser;
6575
6676 $userReqLogged = null; # default is "don't care"
67 - $userReqGroup = "" ; # assuming no group membership required
6877 $output = ""; # assuming the section is hidden by default.
6978
7079 $cond1 = false;
@@ -96,7 +105,7 @@
97106 $cond1 = true;
98107 }
99108 # if both conditions are met, then SHOW else HIDE
100 - if ( ( $cond1 === true ) and ( $cond2 === true ) ) {
 109+ if ( ( $cond1 === true ) && ( $cond2 === true ) ) {
101110 $output = $parser->recursiveTagParse( $input );
102111 }
103112
Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php
@@ -9,7 +9,7 @@
1010 */
1111 public static function getFeeds( $langCode ) {
1212 global $wgMemc, $wgContLang;
13 -
 13+
1414 if ( !$langCode ) {
1515 $langCode = $wgContLang->getCode();
1616 }
Index: trunk/extensions/wikihiero/wikihiero.php
@@ -70,13 +70,22 @@
7171
7272 $wgCompiledFiles[] = MWInit::extCompiledPath( 'wikihiero/data/tables.php' );
7373
74 -// Because <hiero> tag is used rarely, we don't need to load its body on every hook call,
75 -// so we keep our simple hook handlers here.
 74+/**
 75+ * Because <hiero> tag is used rarely, we don't need to load its body on every hook call,
 76+ * so we keep our simple hook handlers here.
 77+ *
 78+ * @param $parser Parser
 79+ * @return bool
 80+ */
7681 function wfRegisterWikiHiero( &$parser ) {
7782 $parser->setHook( 'hiero', 'WikiHiero::parserHook' );
7883 return true;
7984 }
8085
 86+/**
 87+ * @param $out OutputPage
 88+ * @return bool
 89+ */
8190 function wfHieroBeforePageDisplay( $out ) {
8291 $out->addModuleStyles( 'ext.wikihiero' );
8392 return true;

Status & tagging log