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

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


Improve some parameter docs

Change-Id: I6bcf254a7a28a3e168af1488fa02ecc443b54022
---
M composer.json
M includes/JCApi.php
M includes/JCContent.php
M includes/JCContentHandler.php
M includes/JCDefaultContentView.php
M includes/JCDefaultObjContentView.php
M includes/JCLuaLibrary.php
M includes/JCMapDataContent.php
M includes/JCObjContent.php
M includes/JCSingleton.php
M includes/JCUtils.php
M includes/JCValidators.php
M phpcs.xml
13 files changed, 38 insertions(+), 35 deletions(-)

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



diff --git a/composer.json b/composer.json
index bf202bf..fd295f4 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
        "scripts": {
                "fix": "phpcbf",
                "test": [
-                       "parallel-lint . --exclude vendor",
+                       "parallel-lint . --exclude vendor --exclude 
node_modules",
                        "phpcs -p -s"
                ]
        }
diff --git a/includes/JCApi.php b/includes/JCApi.php
index 5a33688..2de38ad 100644
--- a/includes/JCApi.php
+++ b/includes/JCApi.php
@@ -160,6 +160,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                return [
diff --git a/includes/JCContent.php b/includes/JCContent.php
index 8128c38..92eef01 100644
--- a/includes/JCContent.php
+++ b/includes/JCContent.php
@@ -23,7 +23,7 @@
        private $rawData = null;
        /** @var stdClass|array */
        protected $data = null;
-       /** @var \Status */
+       /** @var Status */
        private $status;
        /** @var bool */
        private $thorough;
@@ -74,13 +74,14 @@
 
        /**
         * Get content status object
+        * @return Status
         */
        public function getStatus() {
                return $this->status;
        }
 
        /**
-        * @return bool: False if this configuration has parsing or validation 
errors
+        * @return bool False if this configuration has parsing or validation 
errors
         */
        public function isValid() {
                return $this->status->isGood();
@@ -91,10 +92,11 @@
                return $text === '' || $text === '{}';
        }
 
-       /*
+       /**
         * Determines whether this content should be considered a "page" for 
statistics
         * In our case, just making sure it's not empty or a redirect
-        *
+        * @param bool $hasLinks
+        * @return bool
         */
        public function isCountable( $hasLinks = null ) {
                return !$this->isEmpty() && !$this->isRedirect();
diff --git a/includes/JCContentHandler.php b/includes/JCContentHandler.php
index a0e1e4a..ccbf07b 100644
--- a/includes/JCContentHandler.php
+++ b/includes/JCContentHandler.php
@@ -32,7 +32,7 @@
         * Returns the content's text as-is.
         *
         * @param \Content|JCContent $content This is actually a Content object
-        * @param $format string|null
+        * @param string|null $format
         * @return mixed
         */
        public function serializeContent( \Content $content, $format = null ) {
diff --git a/includes/JCDefaultContentView.php 
b/includes/JCDefaultContentView.php
index ea8ce99..c12a53f 100644
--- a/includes/JCDefaultContentView.php
+++ b/includes/JCDefaultContentView.php
@@ -127,7 +127,7 @@
        /**
         * Determine if data is a container and should be rendered as a complex 
structure
         * @param JCContent $content
-        * @param $data
+        * @param array|object $data
         * @param array $path
         * @return bool
         */
@@ -142,7 +142,7 @@
         * Determine if data is a special container that needs to be rendered 
as a comma-separated list.
         * By default,
         * @param JCContent $content
-        * @param $data
+        * @param array|object $data
         * @param array $path
         * @return bool
         */
diff --git a/includes/JCDefaultObjContentView.php 
b/includes/JCDefaultObjContentView.php
index 9024cf6..d2895c5 100644
--- a/includes/JCDefaultObjContentView.php
+++ b/includes/JCDefaultObjContentView.php
@@ -96,7 +96,7 @@
         * Determine if data is a special container that needs to be rendered 
as a comma-separated list.
         * By default,
         * @param JCContent $content
-        * @param $data
+        * @param array|object $data
         * @param array $path
         * @return bool
         */
diff --git a/includes/JCLuaLibrary.php b/includes/JCLuaLibrary.php
index df5781b..c9b01ff 100644
--- a/includes/JCLuaLibrary.php
+++ b/includes/JCLuaLibrary.php
@@ -10,7 +10,7 @@
 
        /**
         * @param string $engine
-        * @param string[] $extraLibraries
+        * @param string[] &$extraLibraries
         *
         * @return bool
         */
diff --git a/includes/JCMapDataContent.php b/includes/JCMapDataContent.php
index 3a05bbf..da2617a 100644
--- a/includes/JCMapDataContent.php
+++ b/includes/JCMapDataContent.php
@@ -31,7 +31,7 @@
        }
 
        /**
-        * @inheritdoc
+        * @inheritDoc
         */
        public function getSafeData( $data ) {
                /** @var Parser */
@@ -79,7 +79,7 @@
         * Recursively walk the geojson to replace localized "title" and 
"description" values
         * with the single string corresponding to the $lang language, or if 
$lang is not set,
         * validates those values and returns true/false if valid
-        * @param object|array $json
+        * @param object|array &$json
         * @param bool|Language $lang
         * @return bool
         */
diff --git a/includes/JCObjContent.php b/includes/JCObjContent.php
index 16b8a81..afa2330 100644
--- a/includes/JCObjContent.php
+++ b/includes/JCObjContent.php
@@ -86,7 +86,7 @@
 
        /**
         * Call this function before performing data validation inside the 
derived validate()
-        * @param $data
+        * @param array|object $data
         * @throws \Exception
         * @return bool if true, validation should be performed, otherwise all 
checks will be ignored
         */
@@ -118,7 +118,10 @@
                return null; // Data will be filter-cloned on demand inside 
self::getData()
        }
 
-       /** Populate this data on-demand for efficiency */
+       /**
+        * Populate this data on-demand for efficiency
+        * @return array
+        */
        public function getData() {
                if ( $this->data === null ) {
                        $this->data = JCUtils::sanitize( $this->validationData, 
true );
diff --git a/includes/JCSingleton.php b/includes/JCSingleton.php
index ab451b4..2697cd7 100644
--- a/includes/JCSingleton.php
+++ b/includes/JCSingleton.php
@@ -574,7 +574,9 @@
        /**
         * Only register NS_CONFIG if running on the MediaWiki instance which 
houses
         * the JSON configs (i.e. META)
-        * @param array $namespaces
+        * @TODO FIXME: Always return true
+        * @param array &$namespaces
+        * @return true|void
         */
        public static function onCanonicalNamespaces( array &$namespaces ) {
                if ( !self::jsonConfigIsStorage() ) {
@@ -606,7 +608,7 @@
        /**
         * Initialize state
         * @param Title $title
-        * @param string $modelId
+        * @param string &$modelId
         * @return bool
         */
        public static function onContentHandlerDefaultModelFor( $title, 
&$modelId ) {
@@ -625,7 +627,7 @@
        /**
         * Instantiate JCContentHandler if we can handle this modelId
         * @param string $modelId
-        * @param \ContentHandler $handler
+        * @param \ContentHandler &$handler
         * @return bool
         */
        public static function onContentHandlerForModelID( $modelId, &$handler 
) {
@@ -723,7 +725,7 @@
         * Override a per-page specific edit page copyright warning
         *
         * @param Title $title
-        * @param string[] $msg
+        * @param string[] &$msg
         *
         * @return bool
         */
@@ -745,7 +747,7 @@
         * Display a page-specific edit notice
         *
         * @param Title $title
-        * @param integer $oldid
+        * @param int $oldid
         * @param array &$notices
         * @return bool
         */
@@ -771,8 +773,8 @@
         *
         * @param Title $title
         * @param string $type
-        * @param string $msg
-        * @param $link
+        * @param string &$msg
+        * @param string &$link
         *
         * @return bool
         */
@@ -907,10 +909,10 @@
        /**
         * Prohibit creation of the pages that are part of our namespaces but 
have not been explicitly
         * allowed. Bad capitalization is due to "userCan" hook name
-        * @param Title $title
-        * @param $user
+        * @param Title &$title
+        * @param User &$user
         * @param string $action
-        * @param null $result
+        * @param null &$result
         * @return bool
         */
        public static function onuserCan(
diff --git a/includes/JCUtils.php b/includes/JCUtils.php
index c128882..f0ce764 100644
--- a/includes/JCUtils.php
+++ b/includes/JCUtils.php
@@ -167,7 +167,7 @@
 
        /** Helper function to check if the given value is a valid string no 
longer than maxlength,
         * that it has no tabs or new line chars, and that it does not begin or 
end with spaces
-        * @param $str
+        * @param string $str
         * @param int $maxlength
         * @return bool
         */
diff --git a/includes/JCValidators.php b/includes/JCValidators.php
index 6c0607b..d836f44 100644
--- a/includes/JCValidators.php
+++ b/includes/JCValidators.php
@@ -228,7 +228,9 @@
                };
        }
 
-       /** Returns a validator function to check if the value is a valid 
header string
+       /**
+        * Returns a validator function to check if the value is a valid header 
string
+        * @param array &$allHeaders
         * @return callable
         */
        public static function isHeaderString( &$allHeaders ) {
@@ -267,7 +269,7 @@
        }
 
        /** Returns a validator function to check if value is a list of a given 
size
-        * @param integer $count
+        * @param int $count
         * @param string $field
         * @return callable
         */
@@ -284,7 +286,7 @@
 
        /** Returns a validator function asserting a string to be one of the 
valid data types.
         * Additionally, a validator function for that data type is appended to 
the $validators array.
-        * @param array $validators
+        * @param array &$validators
         * @return Closure
         */
        public static function validateDataType( &$validators ) {
diff --git a/phpcs.xml b/phpcs.xml
index d7b5190..21b2bef 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,11 +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.Commenting.FunctionComment.MissingReturn" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" 
/>
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
@@ -14,6 +9,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/370895
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6bcf254a7a28a3e168af1488fa02ecc443b54022
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/JsonConfig
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Yurik <yuriastrak...@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