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

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

Improve some parameter docs

Change-Id: I268aaa13d07985b0915774e83c487cd22568b161
---
M GadgetHooks.php
M Gadgets_body.php
M SpecialGadgetUsage.php
M SpecialGadgets.php
M api/ApiQueryGadgetCategories.php
M api/ApiQueryGadgets.php
M includes/GadgetDefinitionNamespaceRepo.php
M includes/GadgetResourceLoaderModule.php
M includes/MediaWikiGadgetsDefinitionRepo.php
M includes/content/GadgetDefinitionContent.php
M phpcs.xml
11 files changed, 36 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gadgets 
refs/changes/72/374072/1

diff --git a/GadgetHooks.php b/GadgetHooks.php
index d19ff3f..5dd756a 100644
--- a/GadgetHooks.php
+++ b/GadgetHooks.php
@@ -26,9 +26,9 @@
        /**
         * PageContentSaveComplete hook handler.
         *
-        * @param $article Article
-        * @param $user User
-        * @param $content Content New page content
+        * @param Article $article
+        * @param User $user
+        * @param Content $content New page content
         * @return bool
         */
        public static function onPageContentSaveComplete( $article, $user, 
$content ) {
@@ -45,7 +45,7 @@
 
        /**
         * UserGetDefaultOptions hook handler
-        * @param $defaultOptions Array of default preference keys and values
+        * @param array &$defaultOptions Array of default preference keys and 
values
         * @return bool
         */
        public static function userGetDefaultOptions( &$defaultOptions ) {
@@ -70,8 +70,8 @@
 
        /**
         * GetPreferences hook handler.
-        * @param $user User
-        * @param $preferences Array: Preference descriptions
+        * @param User $user
+        * @param array &$preferences Preference descriptions
         * @return bool
         */
        public static function getPreferences( $user, &$preferences ) {
@@ -138,7 +138,7 @@
 
        /**
         * ResourceLoaderRegisterModules hook handler.
-        * @param $resourceLoader ResourceLoader
+        * @param ResourceLoader &$resourceLoader
         * @return bool
         */
        public static function registerModules( &$resourceLoader ) {
@@ -157,7 +157,7 @@
 
        /**
         * BeforePageDisplay hook handler.
-        * @param $out OutputPage
+        * @param OutputPage $out
         * @return bool
         */
        public static function beforePageDisplay( $out ) {
@@ -287,7 +287,7 @@
         * in the Gadget namespace based on their file extension
         *
         * @param Title $title
-        * @param string $model
+        * @param string &$model
         * @return bool
         */
        public static function onContentHandlerDefaultModelFor( Title $title, 
&$model ) {
@@ -312,7 +312,7 @@
         * knows the language for Gadget: namespace pages.
         *
         * @param Title $title
-        * @param string $lang
+        * @param string &$lang
         * @return bool
         */
        public static function onCodeEditorGetPageLanguage( Title $title, 
&$lang ) {
diff --git a/Gadgets_body.php b/Gadgets_body.php
index dc37a5f..b197ed2 100644
--- a/Gadgets_body.php
+++ b/Gadgets_body.php
@@ -116,28 +116,28 @@
        }
 
        /**
-        * @return String: Gadget name
+        * @return string Gadget name
         */
        public function getName() {
                return $this->name;
        }
 
        /**
-        * @return String: Gadget description parsed into HTML
+        * @return string Gadget description parsed into HTML
         */
        public function getDescription() {
                return wfMessage( "gadget-{$this->getName()}" )->parse();
        }
 
        /**
-        * @return String: Wikitext of gadget description
+        * @return string Wikitext of gadget description
         */
        public function getRawDescription() {
                return wfMessage( "gadget-{$this->getName()}" )->plain();
        }
 
        /**
-        * @return String: Name of category (aka section) our gadget belongs 
to. Empty string if none.
+        * @return string Name of category (aka section) our gadget belongs to. 
Empty string if none.
         */
        public function getCategory() {
                return $this->category;
@@ -154,8 +154,8 @@
        /**
         * Checks whether this gadget is enabled for given user
         *
-        * @param $user User: user to check against
-        * @return Boolean
+        * @param User $user user to check against
+        * @return bool
         */
        public function isEnabled( $user ) {
                return (bool)$user->getOption( "gadget-{$this->name}", 
$this->onByDefault );
@@ -164,8 +164,8 @@
        /**
         * Checks whether given user has permissions to use this gadget
         *
-        * @param $user User: user to check against
-        * @return Boolean
+        * @param User $user user to check against
+        * @return bool
         */
        public function isAllowed( $user ) {
                return count( array_intersect( $this->requiredRights, 
$user->getRights() ) ) ==
@@ -192,14 +192,14 @@
        }
 
        /**
-        * @return Boolean: Whether all of this gadget's JS components support 
ResourceLoader
+        * @return bool Whether all of this gadget's JS components support 
ResourceLoader
         */
        public function supportsResourceLoader() {
                return $this->resourceLoaded;
        }
 
        /**
-        * @return Boolean: Whether this gadget has resources that can be 
loaded via ResourceLoader
+        * @return bool Whether this gadget has resources that can be loaded 
via ResourceLoaderb
         */
        public function hasModule() {
                return count( $this->styles )
@@ -208,28 +208,28 @@
        }
 
        /**
-        * @return String: Definition for this gadget from 
MediaWiki:gadgets-definition
+        * @return string Definition for this gadget from 
MediaWiki:gadgets-definition
         */
        public function getDefinition() {
                return $this->definition;
        }
 
        /**
-        * @return Array: Array of pages with JS (including namespace)
+        * @return array Array of pages with JS (including namespace)
         */
        public function getScripts() {
                return $this->scripts;
        }
 
        /**
-        * @return Array: Array of pages with CSS (including namespace)
+        * @return array Array of pages with CSS (including namespace)
         */
        public function getStyles() {
                return $this->styles;
        }
 
        /**
-        * @return Array: Array of all of this gadget's resources
+        * @return array Array of all of this gadget's resources
         */
        public function getScriptsAndStyles() {
                return array_merge( $this->scripts, $this->styles );
diff --git a/SpecialGadgetUsage.php b/SpecialGadgetUsage.php
index a8a4720..8415ce1 100644
--- a/SpecialGadgetUsage.php
+++ b/SpecialGadgetUsage.php
@@ -64,6 +64,7 @@
         * LEFT JOIN querycachetwo ON user_name = qcc_title AND qcc_type = 
'activeusers' AND up_value = 1
         * WHERE up_property LIKE 'gadget-%'
         * GROUP BY up_property;
+        * @return array
         */
        public function getQueryInfo() {
                $dbr = wfGetDB( DB_SLAVE );
diff --git a/SpecialGadgets.php b/SpecialGadgets.php
index 4c62d47..6ddffef 100644
--- a/SpecialGadgets.php
+++ b/SpecialGadgets.php
@@ -16,7 +16,7 @@
 
        /**
         * Main execution function
-        * @param $par array Parameters passed to the page
+        * @param array $par Parameters passed to the page
         */
        public function execute( $par ) {
                $parts = explode( '/', $par );
@@ -191,7 +191,7 @@
 
        /**
         * Exports a gadget with its dependencies in a serialized form
-        * @param $gadget String Name of gadget to export
+        * @param string $gadget Name of gadget to export
         */
        public function showExportForm( $gadget ) {
                global $wgScript;
diff --git a/api/ApiQueryGadgetCategories.php b/api/ApiQueryGadgetCategories.php
index c6d2b0d..489f665 100644
--- a/api/ApiQueryGadgetCategories.php
+++ b/api/ApiQueryGadgetCategories.php
@@ -97,6 +97,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                return [
diff --git a/api/ApiQueryGadgets.php b/api/ApiQueryGadgets.php
index 2ec6e55..bd20a76 100644
--- a/api/ApiQueryGadgets.php
+++ b/api/ApiQueryGadgets.php
@@ -93,7 +93,7 @@
        }
 
        /**
-        * @param $gadgets array
+        * @param array $gadgets
         */
        private function applyList( $gadgets ) {
                $data = [];
@@ -125,7 +125,7 @@
        }
 
        /**
-        * @param $gadget Gadget
+        * @param Gadget $gadget
         *
         * @return bool
         */
@@ -138,7 +138,7 @@
        }
 
        /**
-        * @param $g Gadget
+        * @param Gadget $g
         * @return array
         */
        private function fakeMetadata( Gadget $g ) {
@@ -210,6 +210,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                $params = $this->getAllowedParams();
diff --git a/includes/GadgetDefinitionNamespaceRepo.php 
b/includes/GadgetDefinitionNamespaceRepo.php
index 6808db3..297a58f 100644
--- a/includes/GadgetDefinitionNamespaceRepo.php
+++ b/includes/GadgetDefinitionNamespaceRepo.php
@@ -124,7 +124,7 @@
        }
 
        /**
-        * @param $id
+        * @param strng $id
         * @return string
         */
        private function getGadgetCacheKey( $id ) {
diff --git a/includes/GadgetResourceLoaderModule.php 
b/includes/GadgetResourceLoaderModule.php
index 3ed9c26..e1b2602 100644
--- a/includes/GadgetResourceLoaderModule.php
+++ b/includes/GadgetResourceLoaderModule.php
@@ -64,7 +64,7 @@
 
        /**
         * Overrides ResourceLoaderModule::getDependencies()
-        * @param $context ResourceLoaderContext
+        * @param ResourceLoaderContext $context
         * @return string[] Names of resources this module depends on
         */
        public function getDependencies( ResourceLoaderContext $context = null 
) {
diff --git a/includes/MediaWikiGadgetsDefinitionRepo.php 
b/includes/MediaWikiGadgetsDefinitionRepo.php
index c0ae3e0..e6ec9ab 100644
--- a/includes/MediaWikiGadgetsDefinitionRepo.php
+++ b/includes/MediaWikiGadgetsDefinitionRepo.php
@@ -103,7 +103,7 @@
        /**
         * Fetch list of gadgets and returns it as associative array of 
sections with gadgets
         * e.g. [ $name => $gadget1, etc. ]
-        * @param $forceNewText String: Injected text of 
MediaWiki:gadgets-definition [optional]
+        * @param string $forceNewText Injected text of 
MediaWiki:gadgets-definition [optional]
         * @return array|bool
         */
        public function fetchStructuredList( $forceNewText = null ) {
diff --git a/includes/content/GadgetDefinitionContent.php 
b/includes/content/GadgetDefinitionContent.php
index c7b90b0..741b261 100644
--- a/includes/content/GadgetDefinitionContent.php
+++ b/includes/content/GadgetDefinitionContent.php
@@ -50,7 +50,7 @@
         * @param int $revId
         * @param ParserOptions $options
         * @param bool $generateHtml
-        * @param ParserOutput $output
+        * @param ParserOutput &$output
         */
        protected function fillParserOutput( Title $title, $revId,
                ParserOptions $options, $generateHtml, ParserOutput &$output
diff --git a/phpcs.xml b/phpcs.xml
index ad3edb3..21b2bef 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,10 +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.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
@@ -13,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/374072
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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