Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370753 )

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

Improve some parameter docs

Change-Id: I6e2cda92da62074ab4440629235411a2046c6688
---
M DataCollector.php
M HookHandler.php
M TemplateParser.php
M composer.json
M phpcs.xml
M tests/phpunit/ParserTestHelper.php
6 files changed, 14 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommonsMetadata 
refs/changes/53/370753/1

diff --git a/DataCollector.php b/DataCollector.php
index 865dff8..94416ac 100644
--- a/DataCollector.php
+++ b/DataCollector.php
@@ -55,7 +55,7 @@
        }
 
        /**
-        * @param boolean $multiLang
+        * @param bool $multiLang
         */
        public function setMultiLang( $multiLang ) {
                $this->multiLang = $multiLang;
@@ -87,7 +87,7 @@
         * For fields with multiple values and/or in multiple languages the 
format is more complex;
         * see the documentation for the extmetadata API.
         *
-        * @param array $previousMetadata metadata collected so far;
+        * @param array &$previousMetadata metadata collected so far;
         *   new metadata will be added to this array
         * @param File $file
         */
@@ -322,7 +322,7 @@
        /**
         * Matches category names to a category => license mapping, removes the 
matching categories
         * and returns the corresponding licenses.
-        * @param array $categories a list of human-readable category names.
+        * @param array &$categories a list of human-readable category names.
         * @return array
         */
        protected function getLicensesAndRemoveFromCategories( &$categories ) {
@@ -341,7 +341,7 @@
        /**
         * Matches category names to a category => assessment mapping, removes 
the matching categories
         * and returns the corresponding assessments (valued image, picture of 
the day etc).
-        * @param array $categories a list of human-readable category names.
+        * @param array &$categories a list of human-readable category names.
         * @return array
         */
        protected function getAssessmentsAndRemoveFromCategories( &$categories 
) {
@@ -422,7 +422,7 @@
 
        /**
         * Normalizes the metadata to wfTimestamp()'s TS_DB format
-        * @param array $metadata
+        * @param array &$metadata
         */
        protected function normalizeMetadataTimestamps( array &$metadata ) {
                $fieldsToNormalize = [ 'DateTime', 'DateTimeOriginal' ];
diff --git a/HookHandler.php b/HookHandler.php
index 63156de..95ce26c 100644
--- a/HookHandler.php
+++ b/HookHandler.php
@@ -26,7 +26,7 @@
        /**
         * Hook handler for extended metadata
         *
-        * @param array $combinedMeta Metadata so far
+        * @param array &$combinedMeta Metadata so far
         * @param File $file The file object in question
         * @param IContextSource $context Context. Used to select language
         * @param bool $singleLang Get only target language, or all translations
diff --git a/TemplateParser.php b/TemplateParser.php
index 48ebebb..b92f5c4 100644
--- a/TemplateParser.php
+++ b/TemplateParser.php
@@ -123,8 +123,8 @@
         *
         * This is the main entry point to the class.
         *
-        * @param $html String The html to parse
-        * @return Array The properties extracted from the page.
+        * @param string $html The html to parse
+        * @return array The properties extracted from the page.
         */
        public function parsePage( $html ) {
                if ( !$html ) { // DOMDocument does not like empty strings
@@ -207,7 +207,7 @@
         *  not required) to have one of the $informationFieldClasses.
         * @param string $idOrClass id or class identifying the field, per 
$informationFieldClasses Node
         *  is ignored if this is not a key of $informationFieldClasses. Also 
ignored if this is null.
-        * @param array $data
+        * @param array &$data
         */
        protected function parseInformationField(
                DomNavigator $domNavigator, DOMElement $informationField, 
$group, $idOrClass, array &$data
@@ -243,7 +243,7 @@
        /**
         * Sorts info template data groups according to 
$informationFieldClasses, highest priority first
         * Also removes the _type helper keys.
-        * @param array $data info template data, as returned by 
parseInformationFields()
+        * @param array &$data info template data, as returned by 
parseInformationFields()
         */
        protected function sortInformationGroups( array &$data ) {
                // PHP 5.3 does not like class references in closures
@@ -273,7 +273,7 @@
        /**
         * Prunes template data
         * Removes blacklisted templates if they are not alone
-        * @param array $data info template data
+        * @param array &$data info template data
         */
        protected function pruneInfoTemplateData( array &$data ) {
                foreach ( $data as $key => &$group ) {
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/phpcs.xml b/phpcs.xml
index 9ce64b7..b97d925 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -3,9 +3,6 @@
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
                <exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
                <exclude 
name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName"/>
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
@@ -13,7 +10,5 @@
        <file>.</file>
        <arg name="extensions" value="php,php5,inc"/>
        <arg name="encoding" value="UTF-8"/>
-       <exclude-pattern>*/tests/data/*.php</exclude-pattern>
-       <exclude-pattern>vendor</exclude-pattern>
-       <exclude-pattern>node_modules</exclude-pattern>
+       <exclude-pattern>*/tests/data/*\.php</exclude-pattern>
 </ruleset>
diff --git a/tests/phpunit/ParserTestHelper.php 
b/tests/phpunit/ParserTestHelper.php
index d8a5aa8..6c46b99 100644
--- a/tests/phpunit/ParserTestHelper.php
+++ b/tests/phpunit/ParserTestHelper.php
@@ -89,7 +89,7 @@
 
        /**
         * Loads an expected metadata test result.
-        * @param $name
+        * @param string $name
         * @throws \InvalidArgumentException
         * @return array
         */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e2cda92da62074ab4440629235411a2046c6688
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommonsMetadata
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

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

Reply via email to