jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355248 )
Change subject: Use the recommended `@param <type> <variable>` ordering in documentation ...................................................................... Use the recommended `@param <type> <variable>` ordering in documentation Change-Id: I4f3601f34851ff43525b8ac3bbdf9a4691e2d3ef --- M Collection.body.php M Collection.hooks.php M Collection.php M Collection.session.php M Collection.suggest.php M RenderingAPI.php 6 files changed, 84 insertions(+), 87 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/Collection.body.php b/Collection.body.php index 4a1af42..8b705de 100644 --- a/Collection.body.php +++ b/Collection.body.php @@ -24,7 +24,7 @@ public $tempfile; /** - * @param $PODPartners bool|array + * @param bool|array $PODPartners */ public function __construct( $PODPartners = false ) { parent::__construct( "Book" ); @@ -48,7 +48,7 @@ } /** - * @param $par null|string + * @param null|string $par */ public function execute( $par ) { global $wgCollectionMaxArticles; @@ -493,8 +493,8 @@ } /** - * @param $title string - * @param $subtitle string + * @param string $title + * @param string $subtitle */ public static function setTitles( $title, $subtitle ) { $collection = CollectionSession::getCollection(); @@ -516,8 +516,8 @@ } /** - * @param $a array - * @param $b array + * @param array $a + * @param array $b * @return int */ public static function title_cmp( $a, $b ) { @@ -548,7 +548,7 @@ } /** - * @param $name string + * @param string $name */ public static function addChapter( $name ) { $collection = CollectionSession::getCollection(); @@ -563,8 +563,8 @@ } /** - * @param $index int - * @param $name string + * @param int $index + * @param string $name */ public static function renameChapter( $index, $name ) { if ( !is_int( $index ) ) { @@ -579,8 +579,8 @@ } /** - * @param $namespace int - * @param $name string + * @param int $namespace + * @param string $name * @param int $oldid * @return bool */ @@ -593,8 +593,8 @@ } /** - * @param $title Title - * @param $oldid int + * @param Title $title + * @param int $oldid * @return bool */ public static function addArticle( $title, $oldid = 0 ) { @@ -639,9 +639,9 @@ } /** - * @param $namespace string - * @param $name string - * @param $oldid int + * @param string $namespace + * @param string $name + * @param int $oldid * @return bool */ public static function removeArticleFromName( $namespace, $name, $oldid = 0 ) { @@ -650,8 +650,8 @@ } /** - * @param $title Title - * @param $oldid int + * @param Title $title + * @param int $oldid * @return bool */ public static function removeArticle( $title, $oldid = 0 ) { @@ -668,7 +668,7 @@ } /** - * @param $name string + * @param string $name * @return bool */ public static function addCategoryFromName( $name ) { @@ -677,7 +677,7 @@ } /** - * @param $title Title + * @param Title $title * @return bool */ public static function addCategory( $title ) { @@ -727,7 +727,7 @@ } /** - * @param $index int + * @param int $index * @return bool */ public static function removeItem( $index ) { @@ -761,7 +761,7 @@ } /** - * @param $items array + * @param array $items */ public static function setSorting( $items ) { if ( !CollectionSession::hasSession() ) { @@ -868,8 +868,8 @@ } /** - * @param $title Title - * @param $append bool + * @param Title $title + * @param bool $append * @return array|bool */ public function loadCollection( $title, $append = false ) { @@ -910,8 +910,8 @@ } /** - * @param $title Title - * @param $forceOverwrite bool + * @param Title $title + * @param bool $forceOverwrite * @return bool */ public function saveCollection( $title, $forceOverwrite = false ) { @@ -986,10 +986,10 @@ /** * Take an array of arrays, each containing information about one item to be * assembled and exported, and appropriately feed the backend chosen ($writer). - * @param $collection array following the collection/Metabook dictionary formats + * @param array $collection following the collection/Metabook dictionary formats * https://www.mediawiki.org/wiki/Offline_content_generator/metabook.json * https://mwlib.readthedocs.org/en/latest/internals.html#article - * @param $referrer Title object, used only to provide a returnto parameter. + * @param Title $referrer Used only to provide a returnto parameter. * @param $writer A writer registered in the appropriate configuration. */ public function renderCollection( $collection, Title $referrer, $writer ) { @@ -1209,8 +1209,8 @@ /** * Render a single page: fetch page name and revision information, then * assemble and feed to renderCollection() a single-item $collection. - * @param $title Title needs to be full page name aka prefixed title. - * @param $oldid int + * @param Title $title Full page name aka prefixed title. + * @param int $oldid * @param $writer A writer registered in the appropriate configuration. * @return array|null */ diff --git a/Collection.hooks.php b/Collection.hooks.php index 4cc5423..0aa7073 100644 --- a/Collection.hooks.php +++ b/Collection.hooks.php @@ -33,7 +33,7 @@ /** * Callback for hook SkinBuildSidebar * - * @param $skin Skin + * @param Skin $skin * @param $bar * * @return bool @@ -51,7 +51,7 @@ } /** - * @param $skin Skin + * @param Skin $skin * @param $navUrls * @return bool */ @@ -68,7 +68,7 @@ /** * Return HTML-code to be inserted as portlet * - * @param $sk Skin + * @param Skin $sk * * @return string */ @@ -157,7 +157,7 @@ /** * Callback for hook SiteNoticeAfter * @param $siteNotice - * @param $skin Skin + * @param Skin $skin * @return bool */ public static function siteNoticeAfter( &$siteNotice, $skin ) { @@ -202,8 +202,8 @@ } /** - * @param $title Title - * @param $mode string + * @param Title $title + * @param string $mode * @return string */ public static function renderBookCreatorBox( $title, $mode = '' ) { @@ -288,8 +288,8 @@ /** * @param $title - * @param $ajaxHint null - * @param $oldid null|int + * @param $ajaxHint Defaults to null + * @param null|int $oldid * @return string */ public static function getBookCreatorBoxContent( $title, $ajaxHint = null, $oldid = null ) { @@ -305,7 +305,7 @@ /** * @param $imagePath * @param $ajaxHint - * @param $title Title + * @param Title $title * @param $oldid * @return string */ @@ -475,7 +475,7 @@ /** * OutputPageCheckLastModified hook - * @param $modifiedTimes array + * @param array $modifiedTimes * @return bool */ public static function checkLastModified( $modifiedTimes ) { diff --git a/Collection.php b/Collection.php index 20dd1d6..b504070 100644 --- a/Collection.php +++ b/Collection.php @@ -459,8 +459,8 @@ /** * Backend of several following SAJAX function handlers... - * @param String $action provided by the specific handlers internally - * @param String $article title passed in from client + * @param string $action provided by the specific handlers internally + * @param string $article title passed in from client * @return AjaxResponse with JSON-encoded array including HTML fragment. */ function wfCollectionSuggestAction( $action, $article ) { diff --git a/Collection.session.php b/Collection.session.php index 744aefa..efe499c 100644 --- a/Collection.session.php +++ b/Collection.session.php @@ -109,7 +109,7 @@ /** * @param $title - * @param $oldid int + * @param int $oldid * @return int */ public static function findArticle( $title, $oldid = 0 ) { diff --git a/Collection.suggest.php b/Collection.suggest.php index 27b0d12..2ba39cd 100644 --- a/Collection.suggest.php +++ b/Collection.suggest.php @@ -38,16 +38,15 @@ /** * Main entrypoint * - * @param $mode (type string) 'add', 'ban' or 'remove' - * 'add' => add article to the book - * 'ban' => ban article from the proposals - * 'remove' => remove article from the book - * 'addNum' => (type int) add the first $param articles to the collection - * 'addVal' => (type float) add all propossals to the collection with - * a value higher then $param - * @param $param (type string) name of the article to be added, banned or removed - * or a number of articles to add or a value (1 - 1.5) all articles with a - * higher value will be added to the collection + * @param string $mode + * 'add' => add one title to the book. + * 'addAll' => Add a list of titles to the book. + * 'ban' => Ban a title from the proposals. + * 'unban' => Undo a ban. + * 'remove' => Remove a title from the book, and ban it. + * 'removeOnly' => Remove a title without banning it. + * @param string|string[] $param Name of the article to be added, banned + * or removed, or a list of article names to be added. */ public static function run( $mode = '', $param = '' ) { global $wgOut; @@ -65,16 +64,15 @@ /** * Entrypoint for Ajax * - * @param $mode (type string) 'add', 'ban' or 'remove' - * 'add' => add article to the book - * 'ban' => ban article from the proposals - * 'remove' => remove article from the book - * 'addNum' => (type int) add the first $param articles to the collection - * 'addVal' => (type float) add all propossals to the collection with - * a value higher then $param - * @param $param (type string) name of the article to be added, banned or removed - * or a number of articles to add or a value (1 - 1.5) all articles with a - * higher value will be added to the collection + * @param string $mode + * 'add' => add one title to the book. + * 'addAll' => Add a list of titles to the book. + * 'ban' => Ban a title from the proposals. + * 'unban' => Undo a ban. + * 'remove' => Remove a title from the book, and ban it. + * 'removeOnly' => Remove a title without banning it. + * @param string|string[] $param Name of the article to be added, banned + * or removed, or a list of article names to be added. * @return string html-code for the proposallist and the memberlist */ public static function refresh( $mode, $param ) { @@ -148,16 +146,15 @@ /** * Update the session and return the template * - * @param $mode (type string) 'add', 'ban' or 'remove' - * 'add' => add article to the book - * 'ban' => ban article from the proposals - * 'remove' => remove article from the book - * 'addNum' => (type int) add the first $param articles to the collection - * 'addVal' => (type float) add all propossals to the collection with - * a value higher then $param - * @param $param (type string) name of the article to be added, banned or removed - * or a number of articles to add or a value (1 - 1.5) all articles with a - * higher value will be added to the collection + * @param string $mode + * 'add' => add one title to the book. + * 'addAll' => Add a list of titles to the book. + * 'ban' => Ban a title from the proposals. + * 'unban' => Undo a ban. + * 'remove' => Remove a title from the book, and ban it. + * 'removeOnly' => Remove a title without banning it. + * @param string|string[] $param Name of the article to be added, banned + * or removed, or a list of article names to be added. * @return CollectionSuggestTemplate the template for the wikipage */ private static function getCollectionSuggestTemplate( $mode, $param ) { @@ -214,8 +211,8 @@ /** * Add some articles and update the book of the Proposal-Object * - * @param $articleList array with the names of the articles to be added - * @param $prop CollectionProposals the proposal Object + * @param array $articleList with the names of the articles to be added + * @param CollectionProposals $prop the proposal Object */ private static function addArticlesFromName( $articleList, $prop ) { foreach ( $articleList as $article ) { @@ -263,9 +260,9 @@ * constructor * ================================================== * - * @param $coll array the collection - * @param $ban array the list of the banned articles - * @param $props array the list of the proposals + * @param array $coll the collection + * @param array $ban the list of the banned articles + * @param array $props the list of the proposals */ public function __construct( $coll, $ban, $props ) { $this->mPropList = []; @@ -297,11 +294,11 @@ /** * Calculate the new proposals and return it * - * @param $num (type int) number of proposals to be returned + * @param int $num number of proposals to be returned * 0 or less means, that all proposals will be returned * this parameter is optional, the method will return * all proposals by defaulted - * @param $doUpdate (type boolean) when true, $linkList will + * @param bool $doUpdate when true, $linkList will * updated before calculating the proposals * default is true * @return array a 2-dimensional array that contains the proposals @@ -390,7 +387,7 @@ } /** - * @param $title Title + * @param Title $title * @return Title */ private function resolveRedirects( $title ) { @@ -405,8 +402,8 @@ /** * Extract & count links from wikitext * - * @param $num_articles int - * @param $wikitext string article text + * @param int $num_articles + * @param string $wikitext article text * @return array with links and their weights */ private function getWeightedLinks( $num_articles, $wikitext ) { @@ -558,8 +555,8 @@ * Search an article in an array and returns its key or false * if the array doesn't contain the article * - * @param $entry (type string) an articlename - * @param $array array to be searched, it has to 2-dimensional + * @param string $entry an articlename + * @param array $array to be searched, it has to 2-dimensional * the 2nd dimension needs the key 'name' * @return bool|int the key as integer or false */ @@ -575,7 +572,7 @@ /** * Check if an article is banned or belongs to the book/collection * - * @param $link string an articlename + * @param string $link an articlename * @return boolean true: if the article can be added to the proposals * false: if the article can't be added to the proposals */ diff --git a/RenderingAPI.php b/RenderingAPI.php index 4d92fee..d24cd81 100644 --- a/RenderingAPI.php +++ b/RenderingAPI.php @@ -164,7 +164,7 @@ } /** - * @param $collection array + * @param array $collection * @return string */ protected function buildJSONCollection( $collection ) { -- To view, visit https://gerrit.wikimedia.org/r/355248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f3601f34851ff43525b8ac3bbdf9a4691e2d3ef Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org> Gerrit-Reviewer: C. Scott Ananian <canan...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits