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

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

Improve some parameter docs

Change-Id: If8cf19ec0fbf3e14389fec4856f51bd93fff4772
---
M Newsletter.hooks.php
M composer.json
M includes/Newsletter.php
M includes/NewsletterDb.php
M includes/NewsletterEditPage.php
M includes/NewsletterStore.php
M includes/NewsletterValidator.php
M includes/api/ApiNewsletterManage.php
M includes/api/ApiNewsletterSubscribe.php
M includes/content/NewsletterContent.php
M includes/logging/NewsletterLogFormatter.php
M includes/specials/SpecialNewsletter.php
M includes/specials/pagers/NewsletterTablePager.php
M phpcs.xml
14 files changed, 43 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/48/370948/1

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 348f810..927a5a4 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -8,8 +8,8 @@
        /**
         * Function to be called before EchoEvent
         *
-        * @param array $notifications Echo notifications
-        * @param array $notificationCategories Echo notification categories
+        * @param array &$notifications Echo notifications
+        * @param array &$notificationCategories Echo notification categories
         * @return bool
         */
        public static function onBeforeCreateEchoEvent( &$notifications, 
&$notificationCategories ) {
@@ -92,7 +92,7 @@
        /**
         * Allows to add our own error message to LoginForm
         *
-        * @param array $messages
+        * @param array &$messages
         */
        public static function onLoginFormValidErrorMessages( &$messages ) {
                $messages[] = 'newsletter-subscribe-loginrequired'; // on 
Special:Newsletter/id/subscribe
@@ -128,7 +128,7 @@
        /**
         * Handler for UnitTestsList hook.
         * @see http://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
-        * @param &$files Array of unit test files
+        * @param array &$files Array of unit test files
         * @return bool true in all cases
         */
        public static function onUnitTestsList( &$files ) {
@@ -154,7 +154,7 @@
        /**
         * Tables that Extension:UserMerge needs to update
         *
-        * @param array $updateFields
+        * @param array &$updateFields
         * @return bool
         */
        public static function onUserMergeAccountFields( array &$updateFields ) 
{
@@ -210,12 +210,12 @@
        }
 
        /**
-        * @param WikiPage $wikiPage
-        * @param User $user
-        * @param string $reason
-        * @param string $error
-        * @param Status $status
-        * @param $suppress
+        * @param WikiPage &$wikiPage
+        * @param User &$user
+        * @param string &$reason
+        * @param string &$error
+        * @param Status &$status
+        * @param bool $suppress
         * @return bool
         * @throws PermissionsError
         */
@@ -250,7 +250,7 @@
        }
 
        /**
-        * @param PageArchive $archive
+        * @param PageArchive &$archive
         * @param Title $title
         * @return bool
         */
@@ -308,7 +308,7 @@
        /**
         * @param string $contentModel ID of the content model in question
         * @param Title $title the Title in question.
-        * @param $ok Output parameter, whether it is OK to use $contentModel 
on $title.
+        * @param bool &$ok Output parameter, whether it is OK to use 
$contentModel on $title.
         * @return bool
         */
        public static function onContentModelCanBeUsedOn( $contentModel, Title 
$title, &$ok ) {
@@ -324,9 +324,9 @@
         * @param RequestContext $context object implementing the 
IContextSource interface.
         * @param Content $content content of the edit box, as a Content object.
         * @param Status $status Status object to represent errors, etc.
-        * @param $summary string Edit summary for page
+        * @param string $summary Edit summary for page
         * @param User $user the User object representing the user whois 
performing the edit.
-        * @param $minoredit bool whether the edit was marked as minor by the 
user.
+        * @param bool $minoredit whether the edit was marked as minor by the 
user.
         * @return bool
         * @throws ThrottledError
         */
diff --git a/composer.json b/composer.json
index b81bc08..c155170 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
        },
        "scripts": {
                "test": [
-                       "parallel-lint . --exclude vendor",
+                       "parallel-lint . --exclude vendor --exclude 
node_modules",
                        "phpcs -p -s"
                ],
                "fix": "phpcbf"
diff --git a/includes/Newsletter.php b/includes/Newsletter.php
index 820f1ad..7c19753 100644
--- a/includes/Newsletter.php
+++ b/includes/Newsletter.php
@@ -65,6 +65,7 @@
         * Fetch a new newsletter instance from given name
         *
         * @param string $name
+        * @param bool $active
         * @return Newsletter|null
         */
        public static function newFromName( $name, $active = true ) {
diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php
index d6b2870..9f19ed5 100644
--- a/includes/NewsletterDb.php
+++ b/includes/NewsletterDb.php
@@ -325,6 +325,7 @@
         * Fetch the newsletter matching the given name from the DB
         *
         * @param string $name
+        * @param bool $active
         * @return Newsletter|null
         */
        public function getNewsletterFromName( $name, $active = true ) {
@@ -363,7 +364,7 @@
        }
 
        /**
-        * @param $id
+        * @param int $id
         * @return int
         */
        public function getNewsletterSubscribersCount( $id ) {
diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index 9910d52..838cf18 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -98,7 +98,8 @@
         * Create the manage form. If this is on an undo revision action, 
$revId would be set, and we
         * manually load in form data from the reverted revision.
         *
-        * @param integer $revId
+        * @param int $revId
+        * @param int $undoId
         * @return HTMLForm
         */
        protected function getManageForm( $revId, $undoId ) {
diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php
index 738b29a..0ce7d7f 100644
--- a/includes/NewsletterStore.php
+++ b/includes/NewsletterStore.php
@@ -172,6 +172,7 @@
 
        /**
         * @param string $name
+        * @param bool $active
         * @return Newsletter|null
         */
        public function getNewsletterFromName( $name, $active = true ) {
@@ -188,7 +189,7 @@
        }
 
        /**
-        * @param $id
+        * @param int $id
         * @return int
         */
        public function getNewsletterSubscribersCount( $id ) {
diff --git a/includes/NewsletterValidator.php b/includes/NewsletterValidator.php
index f24fc9f..5ff5f51 100644
--- a/includes/NewsletterValidator.php
+++ b/includes/NewsletterValidator.php
@@ -28,7 +28,7 @@
        /**
         * Check whether all input have proper values
         *
-        * @param $new bool
+        * @param bool $new
         * @return Status fatal if invalid, good otherwise
         */
        public function validate( $new ) {
diff --git a/includes/api/ApiNewsletterManage.php 
b/includes/api/ApiNewsletterManage.php
index e674ec5..2e680a5 100644
--- a/includes/api/ApiNewsletterManage.php
+++ b/includes/api/ApiNewsletterManage.php
@@ -72,6 +72,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                return [
diff --git a/includes/api/ApiNewsletterSubscribe.php 
b/includes/api/ApiNewsletterSubscribe.php
index 6e277a9..0545165 100644
--- a/includes/api/ApiNewsletterSubscribe.php
+++ b/includes/api/ApiNewsletterSubscribe.php
@@ -55,6 +55,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                return [
diff --git a/includes/content/NewsletterContent.php 
b/includes/content/NewsletterContent.php
index 712de09..a74a82a 100644
--- a/includes/content/NewsletterContent.php
+++ b/includes/content/NewsletterContent.php
@@ -70,6 +70,7 @@
 
        /**
         * Decode the JSON encoded args
+        * @return bool
         */
        protected function decode() {
                if ( $this->decoded ) {
@@ -242,6 +243,8 @@
         * Build a group of buttons: Manage, Subscribe|Unsubscribe
         * Buttons will be showed to the user only if they are relevant to the 
current user.
         *
+        * @param ParserOptions &$options
+        * @param ParserOutput $output
         * @return string HTML for the button group
         */
        protected function getNewsletterActionButtons( ParserOptions &$options, 
ParserOutput $output
diff --git a/includes/logging/NewsletterLogFormatter.php 
b/includes/logging/NewsletterLogFormatter.php
index 8770efa..6878252 100644
--- a/includes/logging/NewsletterLogFormatter.php
+++ b/includes/logging/NewsletterLogFormatter.php
@@ -10,6 +10,7 @@
 class NewsletterLogFormatter extends LogFormatter {
        /**
         * Reformat the target as a user link if the target was a user
+        * @return array
         */
        public function getMessageParameters() {
                if ( isset( $this->parsedParameters ) ) {
@@ -35,6 +36,9 @@
        /**
         * Format an additional parameter type "newsletter-link", whose value 
is a
         * newsletter ID and name separated by a colon, into a link
+        * @param string $type
+        * @param string $value
+        * @return string
         */
        public function formatParameterValue( $type, $value ) {
                if ( $type !== 'newsletter-link' ) {
diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index c5c92a2..3470df6 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -92,6 +92,7 @@
         * Get the navigation links shown in the subtitle
         *
         * @param string|null $current subpage currently being shown, null if 
default "view" page
+        * @return string
         */
        protected function getNavigationLinks( $current ) {
                $linkRenderer = $this->getLinkRenderer();
diff --git a/includes/specials/pagers/NewsletterTablePager.php 
b/includes/specials/pagers/NewsletterTablePager.php
index 0201d9a..59f35f6 100644
--- a/includes/specials/pagers/NewsletterTablePager.php
+++ b/includes/specials/pagers/NewsletterTablePager.php
@@ -63,7 +63,7 @@
         *
         * @param string $offset The indexpager offset (Number of subscribers)
         * @param int $limit The limit
-        * @param boolean $descending Ascending or descending?
+        * @param bool $descending Ascending or descending?
         * @param string $secondaryOffset For tiebreaking the order (nl_name)
         */
        private function getSubscribedQuery( $offset, $limit, $descending, 
$secondaryOffset ) {
@@ -92,9 +92,9 @@
        /**
         * Add paging conditions for tie-breaking
         *
-        * @param $desc
-        * @param $offset
-        * @param $secondaryOffset
+        * @param string $desc
+        * @param int $offset
+        * @param int $secondaryOffset
         * @return mixed
         */
        private function getSecondaryOrderBy( $desc, $offset, $secondaryOffset 
) {
@@ -116,7 +116,7 @@
         *
         * @param string $offset The indexpager offset (Number of subscribers)
         * @param int $limit The limit
-        * @param boolean $descending Ascending or descending?
+        * @param bool $descending Ascending or descending?
         * @param string $secondaryOffset For tiebreaking the order (nl_name)
         */
        private function getUnsubscribedQuery( $offset, $limit, $descending, 
$secondaryOffset ) {
@@ -144,7 +144,7 @@
        /**
         * Operator for paging.
         *
-        * @param boolean $desc Descending vs Ascending.
+        * @param bool $desc Descending vs Ascending.
         * @return string
         */
        private function getOp( $desc ) {
@@ -332,7 +332,9 @@
                }
        }
 
-       /*
+       /**
+        * @param string $field
+        * @param mixed $value
         * @return array
         */
        public function getCellAttrs( $field, $value ) {
diff --git a/phpcs.xml b/phpcs.xml
index a103125..7c5de36 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" />
@@ -17,6 +12,4 @@
        <file>.</file>
        <arg name="extensions" value="php,php5,inc" />
        <arg name="encoding" value="UTF-8" />
-       <exclude-pattern>node_modules</exclude-pattern>
-       <exclude-pattern>vendor</exclude-pattern>
 </ruleset>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8cf19ec0fbf3e14389fec4856f51bd93fff4772
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
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