From: Ricordisamoa Date: Sat, 30 Apr 2016 10:10:17 +0000 (+0200) Subject: Fix and standardize Doxygen tags X-Git-Tag: 1.31.0-rc.0~7137 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=e64035522d5205d5e1d7664db04babbea8a705aa Fix and standardize Doxygen tags * Use "@param datatype $paramname description" format * String → string, Integer → int etc. * @return $string → @return string Change-Id: I860d222382cb4c5699d313b0600bd22503c8c385 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 352253163c..8f6b202cd6 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3777,7 +3777,7 @@ HTML * Shows a bulletin board style toolbar for common editing functions. * It can be disabled in the user preferences. * - * @param $title Title object for the page being edited (optional) + * @param Title $title Title object for the page being edited (optional) * @return string */ static function getEditToolbar( $title = null ) { diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 13e6340203..d1fcfa3f07 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -325,8 +325,8 @@ class ApiQueryImageInfo extends ApiQueryBase { * allows us to catch certain error conditions early (such as missing * required parameter). * - * @param $image File - * @param $finalParams array List of parameters to transform image with + * @param File $image + * @param array $finalParams List of parameters to transform image with */ protected function checkParameterNormalise( $image, $finalParams ) { $h = $image->getHandler(); diff --git a/includes/compat/normal/UtfNormalUtil.php b/includes/compat/normal/UtfNormalUtil.php index 0bc8d0f92c..8791e4c371 100644 --- a/includes/compat/normal/UtfNormalUtil.php +++ b/includes/compat/normal/UtfNormalUtil.php @@ -30,8 +30,8 @@ use UtfNormal\Utils; /** * Return UTF-8 sequence for a given Unicode code point. * - * @param $codepoint Integer: - * @return String + * @param int $codepoint + * @return string * @throws InvalidArgumentException if fed out of range data. * @public * @deprecated since 1.25, use UtfNormal\Utils directly @@ -45,8 +45,8 @@ function codepointToUtf8( $codepoint ) { * Unicode code points and return a UTF-8 string composed of those * characters. Used by UTF-8 data generation and testing routines. * - * @param $sequence String - * @return String + * @param string $sequence + * @return string * @throws InvalidArgumentException if fed out of range data. * @private * @deprecated since 1.25, use UtfNormal\Utils directly @@ -77,8 +77,8 @@ function utf8ToHexSequence( $str ) { * Determine the Unicode codepoint of a single-character UTF-8 sequence. * Does not check for invalid input data. * - * @param $char String - * @return Integer + * @param string $char + * @return int * @public * @deprecated since 1.25, use UtfNormal\Utils directly */ diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 2f2faed3bd..6e40f4c674 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -172,7 +172,7 @@ class CSSMin { } /** - * @param $file string + * @param string $file * @return bool|string */ public static function getMimeType( $file ) { diff --git a/includes/media/GIF.php b/includes/media/GIF.php index 8ec7298036..5f23855c81 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -193,7 +193,7 @@ class GIFHandler extends BitmapHandler { * * Shown in the &query=imageinfo&iiprop=size api query. * - * @param $file File + * @param File $file * @return float The duration of the file. */ public function getLength( $file ) { diff --git a/includes/media/PNG.php b/includes/media/PNG.php index f9af101af9..8a3e001128 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -180,7 +180,7 @@ class PNGHandler extends BitmapHandler { * * Shown in the &query=imageinfo&iiprop=size api query. * - * @param $file File + * @param File $file * @return float The duration of the file. */ public function getLength( $file ) { diff --git a/includes/media/TransformationalImageHandler.php b/includes/media/TransformationalImageHandler.php index f1f21616db..3287fac8cf 100644 --- a/includes/media/TransformationalImageHandler.php +++ b/includes/media/TransformationalImageHandler.php @@ -288,9 +288,9 @@ abstract class TransformationalImageHandler extends ImageHandler { /** * Get the source file for the transform * - * @param $file File - * @param $params Array - * @return Array Array with keys width, height and path. + * @param File $file + * @param array $params + * @return array Array with keys width, height and path. */ protected function getThumbnailSource( $file, $params ) { return $file->getThumbnailSource( $params ); diff --git a/includes/password/PasswordPolicyChecks.php b/includes/password/PasswordPolicyChecks.php index 7ea87c37b8..d7aee5bd5c 100644 --- a/includes/password/PasswordPolicyChecks.php +++ b/includes/password/PasswordPolicyChecks.php @@ -117,11 +117,11 @@ class PasswordPolicyChecks { /** * Ensure that password isn't in top X most popular passwords * - * @param $policyVal int Cut off to use. Will automatically shrink to the max + * @param int $policyVal Cut off to use. Will automatically shrink to the max * supported for error messages if set to more than max number of passwords on file, * so you can use the PHP_INT_MAX constant here safely. - * @param $user User - * @param $password String + * @param User $user + * @param string $password * @since 1.27 * @return Status */ diff --git a/includes/resourceloader/ResourceLoaderSkinModule.php b/includes/resourceloader/ResourceLoaderSkinModule.php index 490a4ab24d..91e63e70aa 100644 --- a/includes/resourceloader/ResourceLoaderSkinModule.php +++ b/includes/resourceloader/ResourceLoaderSkinModule.php @@ -26,7 +26,7 @@ class ResourceLoaderSkinModule extends ResourceLoaderFileModule { /* Methods */ /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ public function getStyles( ResourceLoaderContext $context ) { @@ -68,7 +68,7 @@ class ResourceLoaderSkinModule extends ResourceLoaderFileModule { } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return bool */ public function isKnownEmpty( ResourceLoaderContext $context ) { @@ -78,7 +78,7 @@ class ResourceLoaderSkinModule extends ResourceLoaderFileModule { } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return string: Hash */ public function getModifiedHash( ResourceLoaderContext $context ) { diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index be5ab923b5..27b6dd4d0a 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -380,7 +380,7 @@ abstract class SearchEngine { * Makes search simple string if it was namespaced. * Sets namespaces of the search to namespaces extracted from string. * @param string $search - * @return $string Simplified search string + * @return string Simplified search string */ protected function normalizeNamespaces( $search ) { // Find a Title which is not an interwiki and is in NS_MAIN diff --git a/includes/specialpage/QueryPage.php b/includes/specialpage/QueryPage.php index 2523810448..1beac43079 100644 --- a/includes/specialpage/QueryPage.php +++ b/includes/specialpage/QueryPage.php @@ -513,8 +513,8 @@ abstract class QueryPage extends SpecialPage { * What is limit to fetch from DB * * Used to make it appear the DB stores less results then it actually does - * @param $uiLimit int Limit from UI - * @param $uiOffset int Offset from UI + * @param int $uiLimit Limit from UI + * @param int $uiOffset Offset from UI * @return int Limit to use for DB (not including extra row to see if at end) */ protected function getDBLimit( $uiLimit, $uiOffset ) { diff --git a/includes/specials/SpecialMediaStatistics.php b/includes/specials/SpecialMediaStatistics.php index 8ba90a6a6a..e51e8b500e 100644 --- a/includes/specials/SpecialMediaStatistics.php +++ b/includes/specials/SpecialMediaStatistics.php @@ -109,12 +109,12 @@ class MediaStatisticsPage extends QueryPage { /** * Output the results of the query. * - * @param $out OutputPage - * @param $skin Skin (deprecated presumably) - * @param $dbr IDatabase - * @param $res ResultWrapper Results from query - * @param $num integer Number of results - * @param $offset integer Paging offset (Should always be 0 in our case) + * @param OutputPage $out + * @param Skin $skin (deprecated presumably) + * @param IDatabase $dbr + * @param ResultWrapper $res Results from query + * @param int $num Number of results + * @param int $offset Paging offset (Should always be 0 in our case) */ protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) { $prevMediaType = null; @@ -168,9 +168,9 @@ class MediaStatisticsPage extends QueryPage { /** * Output a row of the stats table * - * @param $mime String mime type (e.g. image/jpeg) - * @param $count integer Number of images of this type - * @param $totalBytes integer Total space for images of this type + * @param string $mime mime type (e.g. image/jpeg) + * @param int $count Number of images of this type + * @param int $totalBytes Total space for images of this type */ protected function outputTableRow( $mime, $count, $bytes ) { $mimeSearch = SpecialPage::getTitleFor( 'MIMEsearch', $mime ); @@ -230,8 +230,8 @@ class MediaStatisticsPage extends QueryPage { /** * Given a mime type, return a comma separated list of allowed extensions. * - * @param $mime String mime type - * @return String Comma separated list of allowed extensions (e.g. ".ogg, .oga") + * @param string $mime mime type + * @return string Comma separated list of allowed extensions (e.g. ".ogg, .oga") */ private function getExtensionList( $mime ) { $exts = MimeMagic::singleton()->getExtensionsForType( $mime ); @@ -291,7 +291,7 @@ class MediaStatisticsPage extends QueryPage { /** * Output a header for a new media type section * - * @param $mediaType string A media type (e.g. from the MEDIATYPE_xxx constants) + * @param string $mediaType A media type (e.g. from the MEDIATYPE_xxx constants) */ protected function outputMediaType( $mediaType ) { $this->getOutput()->addHTML( @@ -318,8 +318,8 @@ class MediaStatisticsPage extends QueryPage { /** * parse the fake title format that this special page abuses querycache with. * - * @param $fakeTitle String A string formatted as ;;; - * @return Array The constituant parts of $fakeTitle + * @param string $fakeTitle A string formatted as ;;; + * @return array The constituant parts of $fakeTitle */ private function splitFakeTitle( $fakeTitle ) { return explode( ';', $fakeTitle, 4 ); @@ -337,8 +337,8 @@ class MediaStatisticsPage extends QueryPage { * This method isn't used, since we override outputResults, but * we need to implement since abstract in parent class. * - * @param $skin Skin - * @param $result stdObject Result row + * @param Skin $skin + * @param stdObject $result Result row * @return bool|string|void * @throws MWException */ @@ -349,8 +349,8 @@ class MediaStatisticsPage extends QueryPage { /** * Initialize total values so we can figure out percentages later. * - * @param $dbr IDatabase - * @param $res ResultWrapper + * @param IDatabase $dbr + * @param ResultWrapper $res */ public function preprocessResults( $dbr, $res ) { $this->totalCount = $this->totalBytes = 0; diff --git a/tests/phpunit/includes/MergeHistoryTest.php b/tests/phpunit/includes/MergeHistoryTest.php index 5ea0cdf2d6..22f6fa6a58 100644 --- a/tests/phpunit/includes/MergeHistoryTest.php +++ b/tests/phpunit/includes/MergeHistoryTest.php @@ -21,10 +21,10 @@ class MergeHistoryTest extends MediaWikiTestCase { /** * @dataProvider provideIsValidMerge * @covers MergeHistory::isValidMerge - * @param $source string Source page - * @param $dest string Destination page - * @param $timestamp string|bool Timestamp up to which revisions are merged (or false for all) - * @param $error string|bool Expected error for test (or true for no error) + * @param string $source Source page + * @param string $dest Destination page + * @param string|bool $timestamp Timestamp up to which revisions are merged (or false for all) + * @param string|bool $error Expected error for test (or true for no error) */ public function testIsValidMerge( $source, $dest, $timestamp, $error ) { $this->setMwGlobals( 'wgContentHandlerUseDB', false ); diff --git a/tests/phpunit/includes/media/GIFTest.php b/tests/phpunit/includes/media/GIFTest.php index f24b68baf6..aaa3ac4ded 100644 --- a/tests/phpunit/includes/media/GIFTest.php +++ b/tests/phpunit/includes/media/GIFTest.php @@ -150,8 +150,8 @@ class GIFHandlerTest extends MediaWikiMediaTestCase { } /** - * @param $filename string - * @param $expectedLength float + * @param string $filename + * @param float $expectedLength * @dataProvider provideGetLength */ public function testGetLength( $filename, $expectedLength ) { diff --git a/tests/phpunit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php index 1eddaff82f..7a052f6035 100644 --- a/tests/phpunit/includes/media/MediaHandlerTest.php +++ b/tests/phpunit/includes/media/MediaHandlerTest.php @@ -53,9 +53,9 @@ class MediaHandlerTest extends MediaWikiTestCase { * out of parameters: * $width, $height, { $max => $expected, $max2 => $expected2, ... } * - * @param $width int - * @param $height int - * @param $tests array associative array of $max => $expected values + * @param int $width + * @param int $height + * @param array $tests associative array of $max => $expected values * @return array */ private static function generateTestFitBoxWidthData( $width, $height, $tests ) { diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php index afc338e13c..32d54df71e 100644 --- a/tests/phpunit/includes/media/PNGTest.php +++ b/tests/phpunit/includes/media/PNGTest.php @@ -139,8 +139,8 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } /** - * @param $filename string - * @param $expectedLength float + * @param string $filename + * @param float $expectedLength * @dataProvider provideGetLength */ public function testGetLength( $filename, $expectedLength ) {