[MediaWiki-commits] [Gerrit] mediawiki...CommonsMetadata[master]: Improve some parameter docs

2017-08-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
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(-)

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



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 

[MediaWiki-commits] [Gerrit] mediawiki...CommonsMetadata[master]: Improve some parameter docs

2017-08-08 Thread Umherirrender (Code Review)
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