Thiemo Kreuz (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/400412 )
Change subject: Remove superfluous documentation snippets ...................................................................... Remove 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: I2f058e66a49fd42af49fdeb025235f92eea3ab9e --- M includes/MobileContext.php M includes/MobileFormatter.php M includes/MobileFrontend.body.php M includes/MobileFrontend.hooks.php M includes/MobileFrontend.skin.hooks.php M includes/api/ApiMobileView.php M includes/content-providers/ContentProviderFactory.php M includes/content-providers/DefaultContentProvider.php M includes/content-providers/MwApiContentProvider.php M includes/devices/DeviceDetector.php M includes/devices/DeviceDetectorService.php M includes/models/MobilePage.php M includes/specials/SpecialMobileDiff.php M includes/specials/SpecialMobileLanguages.php M includes/specials/SpecialMobileWatchlist.php M tests/phpunit/MobileFrontend.hooksTest.php M tests/phpunit/api/ApiMobileViewTest.php 17 files changed, 42 insertions(+), 53 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/12/400412/1 diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 070650d..d0b70da 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -818,7 +818,7 @@ /** * Take a URL and return a copy that removes any mobile tokens - * @param string $url URL + * @param string $url * @return string */ public function getDesktopUrl( $url ) { @@ -1053,8 +1053,8 @@ /** * Add key/value pairs for analytics purposes to $this->analyticsLogItems - * @param string $key Key - * @param string $val Value + * @param string $key + * @param string $val */ public function addAnalyticsLogItem( $key, $val ) { $key = trim( $key ); diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 938f90b..481e322 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -71,8 +71,6 @@ const SHOW_FIRST_PARAGRAPH_BEFORE_INFOBOX = 'showFirstParagraphBeforeInfobox'; /** - * Constructor - * * @param string $html Text to process * @param Title $title Title to which $html belongs */ @@ -94,7 +92,7 @@ /** * Creates and returns a MobileFormatter * - * @param MobileContext $context MobileContext object + * @param MobileContext $context * @param IContentProvider $provider ContentProvider interface * @param bool $enableSections (optional) * whether to wrap the content of sections @@ -645,8 +643,8 @@ * that the section bodies are clearly defined (to be "expandable" for * example). * - * @param DOMDocument $doc DOM document - * @param DOMElement $headings The headings returned by + * @param DOMDocument $doc + * @param DOMElement[] $headings The headings returned by * {@see MobileFormatter::getHeadings} * @param array $transformOptions Options to pass when transforming content per section */ @@ -780,7 +778,7 @@ * FIXME: <code>in-block</code> isn't semantic in that it isn't * obviously connected to being editable. * - * @param DOMElement $headings Heading elements + * @param DOMElement[] $headings Heading elements */ protected function makeHeadingsEditable( array $headings ) { foreach ( $headings as $heading ) { diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php index d2b059a..1c946d7 100644 --- a/includes/MobileFrontend.body.php +++ b/includes/MobileFrontend.body.php @@ -27,7 +27,7 @@ /** * Transforms content to be mobile friendly version. * Filters out various elements and runs the MobileFormatter. - * @param OutputPage $out OutputPage object + * @param OutputPage $out * @param string $text override out html * * @return string @@ -94,7 +94,7 @@ /** * Generate user page content for non-existent user pages * - * @param OutputPage $output OutputPage object + * @param OutputPage $output * @param User $pageUser owner of the user page * @return string */ diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 37636b8..a483b41 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -41,7 +41,7 @@ * Obtain the default mobile skin * * @param IContextSource $context ContextSource interface - * @param MobileContext $mobileContext MobileContext object + * @param MobileContext $mobileContext * @return Skin */ protected static function getDefaultMobileSkin( IContextSource $context, @@ -132,12 +132,12 @@ * MediaWikiPerformAction hook handler (enable mwui for all pages) * @see https://www.mediawiki.org/wiki/Manual:Hooks/MediaWikiPerformAction * - * @param OutputPage $output OutputPage object - * @param Article $article Article object + * @param OutputPage $output + * @param Article $article * @param Title $title Page title * @param User $user User performing action - * @param RequestContext $request RequestContext object - * @param MediaWiki $wiki MediaWiki object + * @param RequestContext $request + * @param MediaWiki $wiki * @return bool */ public static function onMediaWikiPerformAction( $output, $article, $title, @@ -170,7 +170,7 @@ * * Adds an inline script for lazy loading the images in Grade C browsers. * - * @param Skin $sk Skin object + * @param Skin $sk * @param string &$html bottomScripts text. Append to $text to add additional * text/scripts after the stock bottom scripts. * @return bool @@ -229,7 +229,7 @@ * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageRedirect * * Ensures URLs are handled properly for select special pages. - * @param OutputPage $out OutputPage object + * @param OutputPage $out * @param string &$redirect URL string, modifiable * @param string &$code HTTP code (eg '301' or '302'), modifiable * @return bool @@ -359,7 +359,7 @@ * GetCacheVaryCookies hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/GetCacheVaryCookies * - * @param OutputPage $out OutputPage object + * @param OutputPage $out * @param array &$cookies array of cookies name, add a value to it * if you want to add a cookie that have to vary cache options * @return bool @@ -526,7 +526,7 @@ * RecentChange_save hook handler that tags mobile changes * @see https://www.mediawiki.org/wiki/Manual:Hooks/RecentChange_save * - * @param RecentChange $rc RecentChange object + * @param RecentChange $rc * @return bool */ public static function onRecentChangeSave( RecentChange $rc ) { @@ -585,7 +585,7 @@ * $wgSecureLogin == true - but only when using the * mobile site. * - * @param SpecialPage $special SpecialPage object + * @param SpecialPage $special * @param string $subpage subpage name * @return bool */ @@ -849,7 +849,7 @@ * Saves mobile host so that the CentralAuth wiki could redirect back properly * * @see CentralAuthHooks::doCentralLoginRedirect in CentralAuth extension - * @param CentralAuthUser $centralUser CentralAuthUser object + * @param CentralAuthUser $centralUser * @param array &$data Redirect data * * @return bool @@ -867,7 +867,7 @@ * CentralAuthSilentLoginRedirect hook handler * Points redirects from CentralAuth wiki to mobile domain if user has logged in from it * @see SpecialCentralLogin in CentralAuth extension - * @param CentralAuthUser $centralUser CentralAuthUser object + * @param CentralAuthUser $centralUser * @param string &$url to redirect to * @param array $info token information * @@ -1276,7 +1276,7 @@ /** * Add the base mobile site URL to the siteinfo API output. - * @param ApiQuerySiteinfo $module ApiQuerySiteinfo object + * @param ApiQuerySiteinfo $module * @param array &$result Api result array */ public static function onAPIQuerySiteInfoGeneralInfo( ApiQuerySiteinfo $module, array &$result ) { diff --git a/includes/MobileFrontend.skin.hooks.php b/includes/MobileFrontend.skin.hooks.php index 2479f71..2a24129 100644 --- a/includes/MobileFrontend.skin.hooks.php +++ b/includes/MobileFrontend.skin.hooks.php @@ -67,7 +67,7 @@ * 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 $sk Skin object + * @param Skin $sk * @param string $urlMsgKey Key of i18n message containing terms of use URL (optional) * @return null|string */ @@ -177,8 +177,8 @@ /** * Prepares the footer for the skins serving the desktop and mobile sites. - * @param Skin $skin Skin object - * @param QuickTemplate $tpl QuickTemplate object + * @param Skin $skin + * @param QuickTemplate $tpl */ public static function prepareFooter( $skin, $tpl ) { $title = $skin->getTitle(); @@ -197,11 +197,11 @@ /** * Appends a mobile view link to the desktop footer - * @param Skin $sk Skin object - * @param QuickTemplate $tpl QuickTemplate object - * @param MobileContext $ctx MobileContext object + * @param Skin $sk + * @param QuickTemplate $tpl + * @param MobileContext $ctx * @param Title $title Page title - * @param WebRequest $req Request + * @param WebRequest $req */ public static function desktopFooter( Skin $sk, QuickTemplate $tpl, MobileContext $ctx, Title $title, WebRequest $req @@ -226,11 +226,11 @@ /** * Prepares links used in the mobile footer - * @param Skin $sk Skin object - * @param QuickTemplate $tpl QuickTemplate object - * @param MobileContext $ctx MobileContext object + * @param Skin $sk + * @param QuickTemplate $tpl + * @param MobileContext $ctx * @param Title $title Page title - * @param WebRequest $req Request + * @param WebRequest $req * @return QuickTemplate */ protected static function mobileFooter( Skin $sk, QuickTemplate $tpl, MobileContext $ctx, diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php index c3380c9..63bd2ef 100644 --- a/includes/api/ApiMobileView.php +++ b/includes/api/ApiMobileView.php @@ -472,12 +472,11 @@ } /** - * Creates a ParserOptions instance - * @param WikiPage $wp WikiPage object + * @param WikiPage $wikiPage * @return ParserOptions */ - protected function makeParserOptions( WikiPage $wp ) { - $popt = $wp->makeParserOptions( $this ); + protected function makeParserOptions( WikiPage $wikiPage ) { + $popt = $wikiPage->makeParserOptions( $this ); if ( is_callable( [ $popt, 'setWrapOutputClass' ] ) ) { // Let the client handle it. $popt->setWrapOutputClass( false ); diff --git a/includes/content-providers/ContentProviderFactory.php b/includes/content-providers/ContentProviderFactory.php index a7afc9f..b1762b9 100644 --- a/includes/content-providers/ContentProviderFactory.php +++ b/includes/content-providers/ContentProviderFactory.php @@ -11,8 +11,6 @@ const MCS_API = 'MobileFrontend\\ContentProviders\\McsContentProvider'; /** - * Create an instance of IContentProvider - * * @param GlobalVarConfig $config to allow config specific behaviour * @param OutputPage $out to allow the addition of modules and styles * as required by the content diff --git a/includes/content-providers/DefaultContentProvider.php b/includes/content-providers/DefaultContentProvider.php index 9b5d77e..d4ac271 100644 --- a/includes/content-providers/DefaultContentProvider.php +++ b/includes/content-providers/DefaultContentProvider.php @@ -4,8 +4,6 @@ class DefaultContentProvider implements IContentProvider { /** - * Constructor - * * @param string $html HTML relating to content * @return IContentProvider */ diff --git a/includes/content-providers/MwApiContentProvider.php b/includes/content-providers/MwApiContentProvider.php index 463b94a..25f16f1 100644 --- a/includes/content-providers/MwApiContentProvider.php +++ b/includes/content-providers/MwApiContentProvider.php @@ -8,8 +8,6 @@ protected $html = ''; /** - * Constructor - * * @param string $baseUrl for the MediaWiki API to be used minus query string e.g. /w/api.php * @param OutputPage $out so that the ResourceLoader modules specific to the page can be added * @param string $skinName the skin name the content is being provided for diff --git a/includes/devices/DeviceDetector.php b/includes/devices/DeviceDetector.php index e702e6a..aa5399a 100644 --- a/includes/devices/DeviceDetector.php +++ b/includes/devices/DeviceDetector.php @@ -41,7 +41,7 @@ * `$_SERVER` superglobal within its API, it's expected to be passed as * additional context. * - * @param WebRequest $request Request + * @param WebRequest $request * @param array $server Per the above, the `$_SERVER` superglobal * @return DeviceProperties|null */ diff --git a/includes/devices/DeviceDetectorService.php b/includes/devices/DeviceDetectorService.php index 9f428b2..af44657 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 Config + * @param Config $config * @return DeviceDetectorService */ public static function factory( Config $config ) { diff --git a/includes/models/MobilePage.php b/includes/models/MobilePage.php index f1f4164..8316700 100644 --- a/includes/models/MobilePage.php +++ b/includes/models/MobilePage.php @@ -34,7 +34,6 @@ private $usePageImages; /** - * Constructor * @param Title $title Page title * @param File|bool $file Page image file */ diff --git a/includes/specials/SpecialMobileDiff.php b/includes/specials/SpecialMobileDiff.php index eca275e..2fa233b 100644 --- a/includes/specials/SpecialMobileDiff.php +++ b/includes/specials/SpecialMobileDiff.php @@ -296,7 +296,7 @@ /** * Render the footer including userinfos (Name, Role, Editcount) * - * @param IContextSource $context Context + * @param IContextSource $context */ private function showFooter( IContextSource $context ) { $output = $this->getOutput(); diff --git a/includes/specials/SpecialMobileLanguages.php b/includes/specials/SpecialMobileLanguages.php index 7dfca9a..be5a439 100644 --- a/includes/specials/SpecialMobileLanguages.php +++ b/includes/specials/SpecialMobileLanguages.php @@ -84,7 +84,7 @@ * @see https://phabricator.wikimedia.org/T93500 * @see https://phabricator.wikimedia.org/T172316 * @param array $languageMap array of language names, indexed by code. - * @param array $langObject array of lang objects + * @param array $langObject * @return bool */ private function isLanguageObjectValid( $languageMap, $langObject ) { diff --git a/includes/specials/SpecialMobileWatchlist.php b/includes/specials/SpecialMobileWatchlist.php index 4c6ff54..0d248a2 100644 --- a/includes/specials/SpecialMobileWatchlist.php +++ b/includes/specials/SpecialMobileWatchlist.php @@ -142,7 +142,7 @@ /** * Get the header for the watchlist page - * @param User $user User object + * @param User $user * @param string|null $view the name of the view to show (optional) * If absent user preferences will be consulted. * @return string Parsed HTML diff --git a/tests/phpunit/MobileFrontend.hooksTest.php b/tests/phpunit/MobileFrontend.hooksTest.php index 75084cd..5e1675e 100644 --- a/tests/phpunit/MobileFrontend.hooksTest.php +++ b/tests/phpunit/MobileFrontend.hooksTest.php @@ -118,7 +118,6 @@ */ protected function getContextSetup( $mode, $mfXAnalyticsItems, $title = null ) { MobileContext::resetInstanceForTesting(); - // create a new instance of MobileContext $context = MobileContext::singleton(); // create a DerivativeContext to use in MobileContext later diff --git a/tests/phpunit/api/ApiMobileViewTest.php b/tests/phpunit/api/ApiMobileViewTest.php index 32dae27..848a4fd 100644 --- a/tests/phpunit/api/ApiMobileViewTest.php +++ b/tests/phpunit/api/ApiMobileViewTest.php @@ -34,7 +34,7 @@ return new MockWikiPage( $title ); } - protected function makeParserOptions( WikiPage $wp ) { + protected function makeParserOptions( WikiPage $wikiPage ) { $popt = new ParserOptions( $this->getUser() ); if ( is_callable( [ $popt, 'setWrapOutputClass' ] ) ) { // Let the client handle it. -- To view, visit https://gerrit.wikimedia.org/r/400412 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f058e66a49fd42af49fdeb025235f92eea3ab9e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) <thiemo.kr...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits