jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/383629 )

Change subject: Improve some parameter docs
......................................................................


Improve some parameter docs

Change-Id: Ib896238f89e2d72a6b7022af9a9fd8570d7b1356
---
M ApiCategoryTree.php
M CategoryPageSubclass.php
M CategoryTree.hooks.php
M CategoryTreeFunctions.php
M CategoryTreePage.php
M phpcs.xml
6 files changed, 56 insertions(+), 60 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiCategoryTree.php b/ApiCategoryTree.php
index 153b4f2..4e8ceaf 100644
--- a/ApiCategoryTree.php
+++ b/ApiCategoryTree.php
@@ -63,10 +63,10 @@
        /**
         * Get category tree HTML for the given tree, title, depth and config
         *
-        * @param $ct CategoryTree
-        * @param $title Title
-        * @param $depth int
-        * @param $ctConfig Config Config for CategoryTree
+        * @param CategoryTree $ct
+        * @param Title $title
+        * @param int $depth
+        * @param Config $ctConfig Config for CategoryTree
         * @return string HTML
         */
        private function getHTML( $ct, $title, $depth, $ctConfig ) {
diff --git a/CategoryPageSubclass.php b/CategoryPageSubclass.php
index e655907..56a8853 100644
--- a/CategoryPageSubclass.php
+++ b/CategoryPageSubclass.php
@@ -31,9 +31,9 @@
 
        /**
         * Add a subcategory to the internal lists
-        * @param $cat Category
-        * @param $sortkey
-        * @param $pageLength
+        * @param Category $cat
+        * @param string $sortkey
+        * @param int $pageLength
         */
        function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
                $title = $cat->getTitle();
diff --git a/CategoryTree.hooks.php b/CategoryTree.hooks.php
index 074965d..995ab6d 100644
--- a/CategoryTree.hooks.php
+++ b/CategoryTree.hooks.php
@@ -73,7 +73,7 @@
        }
 
        /**
-        * @param $parser Parser
+        * @param Parser $parser
         * @return bool
         */
        public static function setHooks( $parser ) {
@@ -85,7 +85,7 @@
        /**
         * Entry point for the {{#categorytree}} tag parser function.
         * This is a wrapper around CategoryTreeHooks::parserHook
-        * @param $parser Parser
+        * @param Parser $parser
         * @return array|string
         */
        public static function parserFunction( $parser ) {
@@ -120,8 +120,8 @@
        /**
         * Hook implementation for injecting a category tree into the sidebar.
         * Registered automatically if $wgCategoryTreeSidebarRoot is set to a 
category name.
-        * @param $skin
-        * @param $tpl SkinTemplate
+        * @param Skin $skin
+        * @param SkinTemplate $tpl
         * @return bool
         */
        public static function skinTemplateOutputPageBeforeExec( $skin, $tpl ) {
@@ -138,10 +138,10 @@
        /**
         * Entry point for the <categorytree> tag parser hook.
         * This loads CategoryTreeFunctions.php and calls CategoryTree::getTag()
-        * @param $cat
-        * @param $argv
-        * @param $parser Parser
-        * @param $allowMissing bool
+        * @param string $cat
+        * @param array $argv
+        * @param Parser $parser
+        * @param bool $allowMissing
         * @return bool|string
         */
        public static function parserHook( $cat, $argv, $parser = null, 
$allowMissing = false ) {
@@ -175,8 +175,8 @@
         * Hook callback that injects messages and things into the <head> tag,
         * if needed in the current page.
         * Does nothing if $parserOutput->mCategoryTreeTag is not set
-        * @param $outputPage OutputPage
-        * @param $parserOutput ParserOutput
+        * @param OutputPage $outputPage
+        * @param ParserOutput $parserOutput
         * @return bool
         */
        public static function parserOutput( $outputPage, $parserOutput ) {
@@ -190,8 +190,8 @@
         * BeforePageDisplay hook. This hook is set when 
$wgCategoryTreeForceHeaders
         * is set.
         * Otherwise similar to CategoryTreeHooks::parserOutput.
-        * @param $out OutputPage
-        * @param $skin Skin
+        * @param OutputPage $out
+        * @param Skin $skin
         * @return bool
         */
        public static function addHeaders( OutputPage $out, Skin $skin ) {
@@ -202,8 +202,8 @@
        /**
         * ArticleFromTitle hook, override category page handling
         *
-        * @param $title Title
-        * @param $article Article
+        * @param Title $title
+        * @param Article &$article
         * @return bool
         */
        public static function articleFromTitle( $title, &$article ) {
@@ -215,9 +215,9 @@
 
        /**
         * OutputPageMakeCategoryLinks hook, override category links
-        * @param $out
-        * @param $categories
-        * @param $links
+        * @param OutputPage $out
+        * @param array &$categories
+        * @param array &$links
         * @return bool
         */
        public static function outputPageMakeCategoryLinks( $out, &$categories, 
&$links ) {
@@ -231,9 +231,9 @@
        }
 
        /**
-        * @param $skin
-        * @param $links
-        * @param $result
+        * @param Skin $skin
+        * @param array &$links
+        * @param string &$result
         * @return bool
         */
        public static function skinJoinCategoryLinks( $skin, &$links, &$result 
) {
@@ -247,7 +247,7 @@
        }
 
        /**
-        * @param $vars
+        * @param array &$vars
         * @return bool
         */
        public static function getConfigVars( &$vars ) {
diff --git a/CategoryTreeFunctions.php b/CategoryTreeFunctions.php
index 2ac0cd7..c65838b 100644
--- a/CategoryTreeFunctions.php
+++ b/CategoryTreeFunctions.php
@@ -14,7 +14,7 @@
        public $mOptions = [];
 
        /**
-        * @param $options array
+        * @param array $options
         */
        function __construct( $options ) {
                global $wgCategoryTreeDefaultOptions;
@@ -54,7 +54,7 @@
        }
 
        /**
-        * @param $name string
+        * @param string $name
         * @return mixed
         */
        function getOption( $name ) {
@@ -69,7 +69,7 @@
        }
 
        /**
-        * @param $nn
+        * @param mixed $nn
         * @return array|bool
         */
        static function decodeNamespaces( $nn ) {
@@ -115,7 +115,7 @@
        }
 
        /**
-        * @param $mode
+        * @param mixed $mode
         * @return int|string
         */
        static function decodeMode( $mode ) {
@@ -152,7 +152,7 @@
        /**
         * Helper function to convert a string to a boolean value.
         * Perhaps make this a global function in MediaWiki proper
-        * @param $value
+        * @param mixed $value
         * @return bool|null|string
         */
        static function decodeBoolean( $value ) {
@@ -187,7 +187,7 @@
        }
 
        /**
-        * @param $value
+        * @param mixed $value
         * @return int|string
         */
        static function decodeHidePrefix( $value ) {
@@ -240,8 +240,8 @@
        }
 
        /**
-        * @param $options
-        * @param $enc
+        * @param array $options
+        * @param string $enc
         * @return mixed
         * @throws Exception
         */
@@ -258,7 +258,7 @@
        }
 
        /**
-        * @param $depth null
+        * @param string|null $depth
         * @return string
         */
        function getOptionsAsCacheKey( $depth = null ) {
@@ -278,7 +278,7 @@
        }
 
        /**
-        * @param $depth int|null
+        * @param int|null $depth
         * @return mixed
         */
        function getOptionsAsJsStructure( $depth = null ) {
@@ -303,12 +303,12 @@
        /**
         * Custom tag implementation. This is called by 
CategoryTreeHooks::parserHook, which is used to
         * load CategoryTreeFunctions.php on demand.
-        * @param $parser Parser
-        * @param $category
-        * @param $hideroot bool
-        * @param $attr
-        * @param $depth int
-        * @param $allowMissing bool
+        * @param Parser $parser
+        * @param string $category
+        * @param bool $hideroot
+        * @param string $attr
+        * @param int $depth
+        * @param bool $allowMissing
         * @return bool|string
         */
        function getTag( $parser, $category, $hideroot = false, $attr, $depth = 
1,
@@ -372,8 +372,8 @@
 
        /**
         * Returns a string with an HTML representation of the children of the 
given category.
-        * @param $title Title
-        * @param $depth int
+        * @param Title $title
+        * @param int $depth
         * @return string
         */
        function renderChildren( $title, $depth = 1 ) {
@@ -472,7 +472,7 @@
 
        /**
         * Returns a string with an HTML representation of the parents of the 
given category.
-        * @param $title Title
+        * @param Title $title
         * @return string
         */
        function renderParents( $title ) {
@@ -523,7 +523,7 @@
 
        /**
         * Returns a string with a HTML represenation of the given page.
-        * @param $title Title
+        * @param Title $title
         * @param int $children
         * @return string
         */
@@ -544,9 +544,9 @@
        /**
         * Returns a string with a HTML represenation of the given page.
         * $info must be an associative array, containing at least a Title 
object under the 'title' key.
-        * @param $title Title
-        * @param $cat Category
-        * @param $children int
+        * @param Title $title
+        * @param Category $cat
+        * @param int $children
         * @return string
         */
        function renderNodeInfo( $title, $cat, $children = 0 ) {
@@ -746,7 +746,7 @@
 
        /**
         * Creates a Title object from a user provided (and thus unsafe) string
-        * @param $title string
+        * @param string $title
         * @return null|Title
         */
        static function makeTitle( $title ) {
@@ -770,8 +770,8 @@
 
        /**
         * Internal function to cap depth
-        * @param $mode
-        * @param $depth
+        * @param string $mode
+        * @param int $depth
         * @return int|mixed
         */
        static function capDepth( $mode, $depth ) {
diff --git a/CategoryTreePage.php b/CategoryTreePage.php
index c6501d9..d4be6e0 100644
--- a/CategoryTreePage.php
+++ b/CategoryTreePage.php
@@ -23,7 +23,7 @@
        }
 
        /**
-        * @param $name
+        * @param string $name
         * @return mixed
         */
        function getOption( $name ) {
@@ -38,7 +38,7 @@
 
        /**
         * Main execution function
-        * @param $par array Parameters passed to the page
+        * @param string|null $par Parameters passed to the page
         */
        function execute( $par ) {
                global $wgCategoryTreeDefaultOptions, 
$wgCategoryTreeSpecialPageOptions,
diff --git a/phpcs.xml b/phpcs.xml
index c0e59b5..d473d2b 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,8 +2,6 @@
 <ruleset>
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
                <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
                <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
@@ -13,6 +11,4 @@
        <file>.</file>
        <arg name="extensions" value="php,php5,inc" />
        <arg name="encoding" value="UTF-8" />
-       <exclude-pattern>vendor</exclude-pattern>
-       <exclude-pattern>node_modules</exclude-pattern>
 </ruleset>

-- 
To view, visit https://gerrit.wikimedia.org/r/383629
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib896238f89e2d72a6b7022af9a9fd8570d7b1356
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to