Minor cleanups
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 1 Apr 2015 00:13:47 +0000 (17:13 -0700)
committerUmherirrender <umherirrender_de.wp@web.de>
Thu, 2 Apr 2015 16:22:42 +0000 (16:22 +0000)
* Declare undeclared variables
* Kill unused variables
* Fix comments including PHPDoc

Change-Id: I60015f6b6740aa9088bda3745f4dc4e65e29fcb1

includes/parser/CoreParserFunctions.php
includes/parser/DateFormatter.php
includes/parser/Parser.php
includes/parser/ParserOptions.php
includes/parser/ParserOutput.php
tests/phpunit/MediaWikiTestCase.php

index 2b495b1..830a68f 100644 (file)
@@ -893,9 +893,17 @@ class CoreParserFunctions {
                }
        }
 
-       // 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 @@ class CoreParserFunctions {
         * 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 ) {
index 3db8d1e..ef295ab 100644 (file)
@@ -33,7 +33,7 @@ class DateFormatter {
        public $regexes, $pDays, $pMonths, $pYears;
        public $rules, $xMonths, $preferences;
 
-       protected $lang;
+       protected $lang, $mLinked;
 
        const ALL = -1;
        const NONE = 0;
index 40b0a4f..7c221d8 100644 (file)
@@ -147,7 +147,11 @@ class Parser {
         */
        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 @@ class Parser {
                 */
 
                global $wgShowHostnames;
-               $fname = __METHOD__ . '-' . wfGetCaller();
 
                if ( $clearState ) {
                        $magicScopeVariable = $this->lock();
@@ -1199,7 +1202,7 @@ class Parser {
         *
         * @param string $text
         * @param bool $isMain
-        * @param bool $frame
+        * @param PPFrame|bool $frame
         *
         * @return string
         */
@@ -5427,7 +5430,7 @@ class Parser {
        }
 
        /**
-        * @param string $handler
+        * @param MediaHandler $handler
         * @return array
         */
        public function getImageParams( $handler ) {
index 9e06ee2..5fa52ff 100644 (file)
@@ -669,6 +669,7 @@ class ParserOptions {
         *
         * This ignores report limit settings that only affect HTML comments
         *
+        * @param ParserOptions $other
         * @return bool
         * @since 1.25
         */
index bae3eaa..65b527c 100644 (file)
@@ -57,6 +57,7 @@ class ParserOutput extends CacheTime {
        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>))#';
index 0253284..72cac05 100644 (file)
@@ -104,7 +104,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                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 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @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 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        /**
         * @since 1.18
         *
-        * @param DataBaseBase $db
+        * @param DatabaseBase $db
         *
         * @return array
         */