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

Change subject: Remove some more superfluous documentation snippets
......................................................................


Remove some more superfluous documentation snippets

This patch mostly removes redundant stuff from lines like

@param ClassName $variableName ClassName object

where the later "ClassName object" does not add anything to what's
already entirely obvious from the ClassName and the $variableName
before.

Such documentation is worse than having no documentation, because one
must read it first to understand that it does not explain anything.

This patch makes room for future improvements.

Change-Id: I6a9172498a18a195a530664388bbbd4ac815317a
---
M .phpcs.xml
M includes/MobileFormatter.php
M includes/MobileFrontend.hooks.php
M includes/MobileFrontend.skin.hooks.php
M includes/api/ApiMobileView.php
M includes/api/ApiParseExtender.php
M includes/devices/DeviceDetectorService.php
M includes/devices/DeviceProperties.php
M includes/diff/InlineDifferenceEngine.php
M includes/models/MobileCollection.php
M includes/modules/MFResourceLoaderParsedMessageModule.php
M includes/modules/MobileSiteModule.php
M includes/specials/SpecialMobileDiff.php
M includes/specials/SpecialMobileWatchlist.php
14 files changed, 37 insertions(+), 42 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index 823e11a..21aef4b 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0"?>
 <ruleset>
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
        </rule>
        <rule ref="Generic.Files.LineLength">
                <exclude-pattern>MobileFrontend\.alias\.php</exclude-pattern>
@@ -11,9 +12,6 @@
        </rule>
        <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
                <exclude-pattern>tests/phpunit/*</exclude-pattern>
-       </rule>
-       <rule ref="MediaWiki.Commenting.FunctionComment.MissingParamComment">
-               
<exclude-pattern>includes/MobileFrontend\.*\.php</exclude-pattern>
        </rule>
        <file>.</file>
        <arg name="extensions" value="php,php5,inc"/>
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index a4ada4d..55429ba 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -94,7 +94,7 @@
         *
         * @param MobileContext $context in which the page is being rendered. 
Needed to access page title
         *  and MobileFrontend configuration.
-        * @param IContentProvider $provider ContentProvider interface
+        * @param IContentProvider $provider
         * @param bool $enableSections (optional)
         *  whether to wrap the content of sections
         * @param bool $includeTOC (optional) whether to include the
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 9c91909..457ca02 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -152,11 +152,11 @@
         *
         * Adds a link to view the current page in 'mobile view' to the desktop 
footer.
         *
-        * @param SkinTemplate &$skin SkinTemplate object
-        * @param QuickTemplate &$tpl QuickTemplate object
+        * @param Skin &$skin
+        * @param QuickTemplate &$tpl
         * @return bool
         */
-       public static function onSkinTemplateOutputPageBeforeExec( &$skin, 
&$tpl ) {
+       public static function onSkinTemplateOutputPageBeforeExec( Skin &$skin, 
QuickTemplate &$tpl ) {
                MobileFrontendSkinHooks::prepareFooter( $skin, $tpl );
                return true;
        }
@@ -172,7 +172,7 @@
         *                      text/scripts after the stock bottom scripts.
         * @return bool
         */
-       public static function onSkinAfterBottomScripts( $skin, &$html ) {
+       public static function onSkinAfterBottomScripts( Skin $skin, &$html ) {
                $context = MobileContext::singleton();
 
                // TODO: We may want to enable the following script on Desktop 
Minerva...
@@ -295,7 +295,7 @@
         *
         * @param array &$testModules array of javascript testing modules,
         *                            keyed by framework (e.g. 'qunit').
-        * @param ResourceLoader &$resourceLoader ResourceLoader object
+        * @param ResourceLoader &$resourceLoader
         * @return bool
         */
        public static function onResourceLoaderTestModules( array &$testModules,
@@ -547,7 +547,7 @@
         *
         * @see hooks.txt in AbuseFilter extension
         * @param AbuseFilterVariableHolder $vars object to add vars to
-        * @param User $user object
+        * @param User $user
         * @return bool
         */
        public static function onAbuseFilterGenerateUserVars( $vars, $user ) {
@@ -666,11 +666,11 @@
         * BeforePageDisplay hook handler
         * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
         *
-        * @param OutputPage &$out The OutputPage object.
+        * @param OutputPage &$out
         * @param Skin &$skin Skin object that will be used to generate the 
page, added in 1.13.
         * @return bool
         */
-       public static function onBeforePageDisplay( &$out, &$skin ) {
+       public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
                $context = MobileContext::singleton();
                $config = $context->getMFConfig();
                $mfEnableXAnalyticsLogging = $config->get( 
'MFEnableXAnalyticsLogging' );
@@ -891,7 +891,7 @@
         *
         * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules
         *
-        * @param ResourceLoader &$resourceLoader The ResourceLoader object
+        * @param ResourceLoader &$resourceLoader
         * @return bool Always true
         */
        public static function onResourceLoaderRegisterModules( ResourceLoader 
&$resourceLoader ) {
@@ -1022,7 +1022,7 @@
         * that no additional assets are requested by the ResourceLoader, i.e. 
they are stub
         * modules.
         *
-        * @param ResourceLoader $resourceLoader The ResourceLoader object
+        * @param ResourceLoader $resourceLoader
         */
        private static function registerMobileLoggingSchemasModule( 
$resourceLoader ) {
                $mfResourceFileModuleBoilerplate = [
@@ -1082,7 +1082,7 @@
         * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput
         *
         * @param OutputPage $outputPage the OutputPage object to which 
wikitext is added
-        * @param ParserOutput $po a ParserOutput object.
+        * @param ParserOutput $po
         * @return bool
         */
        public static function onOutputPageParserOutput( $outputPage, 
ParserOutput $po ) {
@@ -1128,7 +1128,7 @@
         * See 
https://www.mediawiki.org/wiki/Manual:Hooks/ThumbnailBeforeProduceHTML
         * for more detail about the `ThumbnailBeforeProduceHTML` hook.
         *
-        * @param ThumbnailImage $thumbnail The thumbnail
+        * @param ThumbnailImage $thumbnail
         * @param array &$attribs The attributes of the DOMElement being 
contructed
         *  to represent the thumbnail
         * @param array &$linkAttribs The attributes of the DOMElement being
diff --git a/includes/MobileFrontend.skin.hooks.php 
b/includes/MobileFrontend.skin.hooks.php
index 65b2453..687361f 100644
--- a/includes/MobileFrontend.skin.hooks.php
+++ b/includes/MobileFrontend.skin.hooks.php
@@ -67,12 +67,11 @@
         * Returns HTML of terms of use link or null if it shouldn't be 
displayed
         * Note: This is called by a hook in the WikimediaMessages extension.
         *
-        * @param Skin $skin
-        * @param string $urlMsgKey Key of i18n message containing terms of use 
URL (optional)
+        * @param MessageLocalizer $localizer
         * @return null|string
         */
-       public static function getTermsLink( $skin, $urlMsgKey = 
'mobile-frontend-terms-url' ) {
-               $urlMsg = $skin->msg( $urlMsgKey )->inContentLanguage();
+       public static function getTermsLink( MessageLocalizer $localizer ) {
+               $urlMsg = $localizer->msg( 'mobile-frontend-terms-url' 
)->inContentLanguage();
                if ( $urlMsg->isDisabled() ) {
                        return null;
                }
@@ -81,7 +80,7 @@
                return Html::element(
                        'a',
                        [ 'href' => Skin::makeInternalOrExternalUrl( $url ) ],
-                       $skin->msg( 'mobile-frontend-terms-text' )->text()
+                       $localizer->msg( 'mobile-frontend-terms-text' )->text()
                );
        }
 
@@ -180,7 +179,7 @@
         * @param Skin $skin
         * @param QuickTemplate $tpl
         */
-       public static function prepareFooter( $skin, $tpl ) {
+       public static function prepareFooter( Skin $skin, QuickTemplate $tpl ) {
                $title = $skin->getTitle();
                $req = $skin->getRequest();
                $ctx = MobileContext::singleton();
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index e0720d3..3f2505a 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -444,11 +444,11 @@
 
        /**
         * Performs a page parse
-        * @param WikiPage $wikiPage Wiki page object
-        * @param ParserOptions $parserOptions Options for parser
+        * @param WikiPage $wikiPage
+        * @param ParserOptions $parserOptions
         * @param null|int $oldid Revision ID to get the text from, passing 
null or 0 will
         *   get the current revision (default value)
-        * @return ParserOutput|null
+        * @return ParserOutput|bool
         */
        protected function getParserOutput(
                WikiPage $wikiPage,
@@ -490,7 +490,7 @@
         * Parses section data
         * @param string $html representing the entire page
         * @param Title $title Page title
-        * @param ParserOutput $parserOutput Options for parser
+        * @param ParserOutput $parserOutput
         * @param int $revId this is a temporary parameter to avoid debug log 
warnings.
         *  Long term the call to wfDebugLog should be moved outside this 
method (optional)
         * @return array structure representing the list of sections and their 
properties:
diff --git a/includes/api/ApiParseExtender.php 
b/includes/api/ApiParseExtender.php
index 6e4af35..01673f9 100644
--- a/includes/api/ApiParseExtender.php
+++ b/includes/api/ApiParseExtender.php
@@ -8,7 +8,7 @@
        /**
         * APIGetAllowedParams hook handler
         * @see https://www.mediawiki.org/wiki/Manual:Hooks/APIGetAllowedParams
-        * @param ApiBase &$module Module object
+        * @param ApiBase &$module
         * @param array|bool &$params Array of parameters
         * @return bool
         */
@@ -24,7 +24,7 @@
        /**
         * APIGetParamDescription hook handler
         * @see: 
https://www.mediawiki.org/wiki/Manual:Hooks/APIGetParamDescription
-        * @param ApiBase &$module Module object
+        * @param ApiBase &$module
         * @param array|bool &$params Array of parameter descriptions
         * @return bool
         */
@@ -40,7 +40,7 @@
        /**
         * APIGetDescription hook handler
         * @see: https://www.mediawiki.org/wiki/Manual:Hooks/APIGetDescription
-        * @param ApiBase &$module Module object
+        * @param ApiBase &$module
         * @param array|string &$desc Array of descriptions
         * @return bool
         */
@@ -55,7 +55,7 @@
        /**
         * APIAfterExecute hook handler
         * @see: https://www.mediawiki.org/wiki/Manual:Hooks/APIAfterExecute
-        * @param ApiBase &$module Module object
+        * @param ApiBase &$module
         * @return bool
         */
        public static function onAPIAfterExecute( ApiBase &$module ) {
diff --git a/includes/devices/DeviceDetectorService.php 
b/includes/devices/DeviceDetectorService.php
index 152dfcc..3a7a28f 100644
--- a/includes/devices/DeviceDetectorService.php
+++ b/includes/devices/DeviceDetectorService.php
@@ -23,7 +23,7 @@
         * If `$wgMFAutodetectMobileView` is falsy, then no device detection 
will
         * occur.
         *
-        * @param Config $config containing values forq MFAutodetectMobileView 
and MFMobileHeader
+        * @param Config $config containing values for MFAutodetectMobileView 
and MFMobileHeader
         * @return DeviceDetectorService
         */
        public static function factory( Config $config ) {
@@ -47,7 +47,7 @@
        private $children;
 
        /**
-        * @param DeviceDetector[] $children Array of device detectors
+        * @param DeviceDetector[] $children
         */
        public function __construct( array $children ) {
                $this->children = $children;
diff --git a/includes/devices/DeviceProperties.php 
b/includes/devices/DeviceProperties.php
index 15e9b6d..62cddc3 100644
--- a/includes/devices/DeviceProperties.php
+++ b/includes/devices/DeviceProperties.php
@@ -32,8 +32,8 @@
        private $isTabletDevice;
 
        /**
-        * @param bool $isMobileDevice Is mobile device?
-        * @param bool $isTabletDevice Is tablet device?
+        * @param bool $isMobileDevice
+        * @param bool $isTabletDevice
         */
        public function __construct( $isMobileDevice, $isTabletDevice ) {
                $this->isMobileDevice = $isMobileDevice;
diff --git a/includes/diff/InlineDifferenceEngine.php 
b/includes/diff/InlineDifferenceEngine.php
index bc878e4..015ea6a 100644
--- a/includes/diff/InlineDifferenceEngine.php
+++ b/includes/diff/InlineDifferenceEngine.php
@@ -51,7 +51,7 @@
         * @throws MWException If the content is not an instance of TextContent 
and
         * wgContentHandlerTextFallback was set to 'fail'.
         *
-        * @param bool $diffOnly diff only?
+        * @param bool $diffOnly
         */
        public function showDiffPage( $diffOnly = false ) {
                $output = $this->getOutput();
diff --git a/includes/models/MobileCollection.php 
b/includes/models/MobileCollection.php
index c73f47f..5d793c9 100644
--- a/includes/models/MobileCollection.php
+++ b/includes/models/MobileCollection.php
@@ -30,8 +30,6 @@
        }
 
        /**
-        * Get the Iterator object
-        *
         * @return ArrayIterator
         */
        public function getIterator() {
diff --git a/includes/modules/MFResourceLoaderParsedMessageModule.php 
b/includes/modules/MFResourceLoaderParsedMessageModule.php
index b012b5a..634796e 100644
--- a/includes/modules/MFResourceLoaderParsedMessageModule.php
+++ b/includes/modules/MFResourceLoaderParsedMessageModule.php
@@ -36,7 +36,7 @@
        /**
         * Process messages which have been marked as needing parsing
         *
-        * @param ResourceLoaderContext $context ResourceLoader context
+        * @param ResourceLoaderContext $context
         * @return string JavaScript code
         */
        public function addParsedMessages( ResourceLoaderContext $context ) {
@@ -81,7 +81,7 @@
 
        /**
         * Get the URL or URLs to load for this module's JS in debug mode.
-        * @param ResourceLoaderContext $context ResourceLoader context
+        * @param ResourceLoaderContext $context
         * @return array list of urls
         * @see ResourceLoaderModule::getScriptURLsForDebug
         */
diff --git a/includes/modules/MobileSiteModule.php 
b/includes/modules/MobileSiteModule.php
index ba8baab..4d641ac 100644
--- a/includes/modules/MobileSiteModule.php
+++ b/includes/modules/MobileSiteModule.php
@@ -15,7 +15,7 @@
        /**
         * Get a list of pages used by this module.
         *
-        * @param ResourceLoaderContext $context ResourceLoader context
+        * @param ResourceLoaderContext $context
         * @return array
         */
        protected function getPages( ResourceLoaderContext $context ) {
diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index 35f6d4a..6977122 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -354,7 +354,7 @@
        /**
         * Get the list of groups of user
         * @param User $user The user object to get the list from
-        * @param IContextSource $context The context
+        * @param IContextSource $context
         * @return string comma separated list of user groups
         */
 
diff --git a/includes/specials/SpecialMobileWatchlist.php 
b/includes/specials/SpecialMobileWatchlist.php
index ce15ec6..36bdcad 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -429,7 +429,7 @@
 
        /**
         * Formats a comment of revision via Linker:formatComment and 
Sanitizer::stripAllTags
-        * @param string $comment the comment
+        * @param string $comment
         * @param string $title the title object of comments page
         * @return string formatted comment
         */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a9172498a18a195a530664388bbbd4ac815317a
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to