jenkins-bot has submitted this change and it was merged. Change subject: Minor cleanups ......................................................................
Minor cleanups * Declare undeclared variables * Kill unused variables * Fix comments including PHPDoc Change-Id: I60015f6b6740aa9088bda3745f4dc4e65e29fcb1 --- M includes/parser/CoreParserFunctions.php M includes/parser/DateFormatter.php M includes/parser/Parser.php M includes/parser/ParserOptions.php M includes/parser/ParserOutput.php M tests/phpunit/MediaWikiTestCase.php 6 files changed, 24 insertions(+), 12 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 2b495b1..830a68f 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -893,9 +893,17 @@ } } - // Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} - // or {{filepath|300|nowiki}} or {{filepath|300px}}, {{filepath|200x300px}}, - // {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}. + /** + * Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} + * or {{filepath|300|nowiki}} or {{filepath|300px}}, {{filepath|200x300px}}, + * {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}. + * + * @param Parser $parser + * @param string $name + * @param string $argA + * @param string $argB + * @return array|string + */ public static function filepath( $parser, $name = '', $argA = '', $argB = '' ) { $file = wfFindFile( $name ); @@ -934,7 +942,7 @@ * Parser function to extension tag adaptor * @param Parser $parser * @param PPFrame $frame - * @param array $args + * @param PPNode[] $args * @return string */ public static function tagObj( $parser, $frame, $args ) { diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index 3db8d1e..ef295ab 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -33,7 +33,7 @@ public $regexes, $pDays, $pMonths, $pYears; public $rules, $xMonths, $preferences; - protected $lang; + protected $lang, $mLinked; const ALL = -1; const NONE = 0; diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 40b0a4f..7c221d8 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -147,7 +147,11 @@ */ public $mSubstWords; # Initialised in constructor - public $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; + public $mConf, $mExtLinkBracketedRegex, $mUrlProtocols; + + # Initialized in getPreprocessor() + /** @var Preprocessor */ + public $mPreprocessor; # Cleared with clearState(): /** @@ -393,7 +397,6 @@ */ global $wgShowHostnames; - $fname = __METHOD__ . '-' . wfGetCaller(); if ( $clearState ) { $magicScopeVariable = $this->lock(); @@ -1199,7 +1202,7 @@ * * @param string $text * @param bool $isMain - * @param bool $frame + * @param PPFrame|bool $frame * * @return string */ @@ -5427,7 +5430,7 @@ } /** - * @param string $handler + * @param MediaHandler $handler * @return array */ public function getImageParams( $handler ) { diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 9e06ee2..5fa52ff 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -669,6 +669,7 @@ * * This ignores report limit settings that only affect HTML comments * + * @param ParserOptions $other * @return bool * @since 1.25 */ diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index bae3eaa..65b527c 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -57,6 +57,7 @@ private $mLimitReportData = array(); # Parser limit report data private $mParseStartTime = array(); # Timestamps for getTimeSinceStart() private $mPreventClickjacking = false; # Whether to emit X-Frame-Options: DENY + private $mFlags = array(); # Generic flags const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#'; diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 0253284..72cac05 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -104,7 +104,6 @@ ObjectCache::$instances[CACHE_DB] = new HashBagOStuff; $needsResetDB = false; - $logName = get_class( $this ) . '::' . $this->getName( false ); if ( $this->needsDB() ) { // set up a DB connection for this test to use @@ -632,7 +631,7 @@ * @param string $msg */ private function assertEmpty2( $value, $msg ) { - return $this->assertTrue( $value == '', $msg ); + $this->assertTrue( $value == '', $msg ); } private static function unprefixTable( $tableName ) { @@ -648,7 +647,7 @@ /** * @since 1.18 * - * @param DataBaseBase $db + * @param DatabaseBase $db * * @return array */ -- To view, visit https://gerrit.wikimedia.org/r/201078 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60015f6b6740aa9088bda3745f4dc4e65e29fcb1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MaxSem <maxsem.w...@gmail.com> Gerrit-Reviewer: Cscott <canan...@wikimedia.org> Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits