From: Umherirrender Date: Fri, 11 Aug 2017 15:46:31 +0000 (+0200) Subject: Add missing type to @param documentation X-Git-Tag: 1.31.0-rc.0~2409^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=5544cef16b6fdf1a69230ba02cfa4417f18e7cf2 Add missing type to @param documentation Change-Id: I6b2c9c7af9a281fe457099cc3a336a60a25e74aa --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 8f62a85909..fd002d1880 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1963,7 +1963,7 @@ class OutputPage extends ContextSource { } /** - * @param $maxage + * @param int $maxage * @deprecated since 1.27 Use setCdnMaxage() instead */ public function setSquidMaxage( $maxage ) { diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php index c8872d2d57..cd5bf54998 100644 --- a/includes/PHPVersionCheck.php +++ b/includes/PHPVersionCheck.php @@ -231,9 +231,9 @@ HTML; /** * Returns an error page, which is suitable for output to the end user via a web browser. * - * @param $title - * @param $longHtml - * @param $shortText + * @param string $title + * @param string $longHtml + * @param string $shortText * @return string */ function getIndexErrorOutput( $title, $longHtml, $shortText ) { diff --git a/includes/api/ApiCSPReport.php b/includes/api/ApiCSPReport.php index 3a78c1350c..a4a46bb491 100644 --- a/includes/api/ApiCSPReport.php +++ b/includes/api/ApiCSPReport.php @@ -63,9 +63,9 @@ class ApiCSPReport extends ApiBase { /** * Log CSP report, with a different severity depending on $flags - * @param $flags Array Flags for this report - * @param $logLine String text of log entry - * @param $context Array logging context + * @param array $flags Flags for this report + * @param string $logLine text of log entry + * @param array $context logging context */ private function logReport( $flags, $logLine, $context ) { if ( in_array( 'false-positive', $flags ) ) { @@ -80,8 +80,8 @@ class ApiCSPReport extends ApiBase { /** * Get extra notes about the report. * - * @param $report Array The CSP report - * @return Array + * @param array $report The CSP report + * @return array */ private function getFlags( $report ) { $reportOnly = $this->getParameter( 'reportonly' ); @@ -155,9 +155,9 @@ class ApiCSPReport extends ApiBase { /** * Get text of log line. * - * @param $flags Array of additional markers for this report - * @param $report Array the csp report - * @return String Text to put in log + * @param array $flags of additional markers for this report + * @param array $report the csp report + * @return string Text to put in log */ private function generateLogLine( $flags, $report ) { $flagText = ''; @@ -177,8 +177,8 @@ class ApiCSPReport extends ApiBase { /** * Stop processing the request, and output/log an error * - * @param $code String error code - * @param $method String method that made error + * @param string $code error code + * @param string $method method that made error * @throws ApiUsageException Always */ private function error( $code, $method ) { diff --git a/includes/collation/NumericUppercaseCollation.php b/includes/collation/NumericUppercaseCollation.php index 8dd7a38f3a..da78a05143 100644 --- a/includes/collation/NumericUppercaseCollation.php +++ b/includes/collation/NumericUppercaseCollation.php @@ -40,7 +40,7 @@ class NumericUppercaseCollation extends UppercaseCollation { private $digitTransformLang; /** - * @param $lang Language How to convert digits. + * @param Language $lang How to convert digits. * For example, if given language "my" than ၇ is treated like 7. * * It is expected that usually this is given $wgContLang. @@ -76,8 +76,8 @@ class NumericUppercaseCollation extends UppercaseCollation { * * based on Language::parseFormattedNumber but without commas. * - * @param $string String sortkey to unlocalize digits of - * @return String Sortkey with all localized digits replaced with ASCII digits. + * @param string $string sortkey to unlocalize digits of + * @return string Sortkey with all localized digits replaced with ASCII digits. */ private function convertDigits( $string ) { $table = $this->digitTransformLang->digitTransformTable(); diff --git a/includes/content/JsonContent.php b/includes/content/JsonContent.php index 2f4554731e..2b94f3f71e 100644 --- a/includes/content/JsonContent.php +++ b/includes/content/JsonContent.php @@ -22,6 +22,7 @@ class JsonContent extends TextContent { /** * @param string $text JSON + * @param string $modelId */ public function __construct( $text, $modelId = CONTENT_MODEL_JSON ) { parent::__construct( $text, $modelId ); diff --git a/includes/content/TextContent.php b/includes/content/TextContent.php index 45d00c5e42..5f585bc98a 100644 --- a/includes/content/TextContent.php +++ b/includes/content/TextContent.php @@ -157,7 +157,7 @@ class TextContent extends AbstractContent { * changes. * * @since 1.28 - * @param $text + * @param string $text * @return string */ public static function normalizeLineEndings( $text ) { diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index cc8159c5b7..d60d801bed 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -267,8 +267,8 @@ EOT; } /** - * @param $dir - * @param $db + * @param string $dir + * @param string $db * @return Status */ protected function makeStubDBFile( $dir, $db ) { diff --git a/includes/libs/IEUrlExtension.php b/includes/libs/IEUrlExtension.php index e55bebc93a..2d1c58b66a 100644 --- a/includes/libs/IEUrlExtension.php +++ b/includes/libs/IEUrlExtension.php @@ -133,8 +133,8 @@ class IEUrlExtension { /** * Returns a variant of $url which will pass isUrlExtensionBad() but has the * same GET parameters, or false if it can't figure one out. - * @param $url - * @param $extWhitelist array + * @param string $url + * @param array $extWhitelist * @return bool|string */ public static function fixUrlForIE6( $url, $extWhitelist = [] ) { @@ -251,7 +251,7 @@ class IEUrlExtension { * or a specification in the style of a User-Agent header, such as * "Apache/1.3.34 (Unix) mod_ssl/2.8.25 OpenSSL/0.9.8a PHP/4.4.2" * - * @param $serverSoftware + * @param string $serverSoftware * @return bool */ public static function haveUndecodedRequestUri( $serverSoftware ) { diff --git a/includes/libs/mime/IEContentAnalyzer.php b/includes/libs/mime/IEContentAnalyzer.php index badcb2bced..dfc7c4b431 100644 --- a/includes/libs/mime/IEContentAnalyzer.php +++ b/includes/libs/mime/IEContentAnalyzer.php @@ -344,7 +344,7 @@ class IEContentAnalyzer { /** * Translate a MIME type from IE's idiosyncratic private types into * more commonly understood type strings - * @param $type + * @param string $type * @return string */ public function translateMimeType( $type ) { @@ -383,10 +383,10 @@ class IEContentAnalyzer { /** * Get the MIME type for a given named version - * @param $version - * @param $fileName - * @param $chunk - * @param $proposed + * @param string $version + * @param string $fileName + * @param string $chunk + * @param string $proposed * @return bool|string */ protected function getMimeTypeForVersion( $version, $fileName, $chunk, $proposed ) { @@ -553,8 +553,8 @@ class IEContentAnalyzer { /** * Check for text headers at the start of the chunk * Confirmed same in 5 and 7. - * @param $version - * @param $chunk + * @param string $version + * @param string $chunk * @return bool|string */ private function checkTextHeaders( $version, $chunk ) { @@ -579,8 +579,8 @@ class IEContentAnalyzer { /** * Check for binary headers at the start of the chunk * Confirmed same in 5 and 7. - * @param $version - * @param $chunk + * @param string $version + * @param string $chunk * @return bool|string */ private function checkBinaryHeaders( $version, $chunk ) { @@ -680,8 +680,8 @@ class IEContentAnalyzer { /** * Do heuristic checks on the bulk of the data sample. * Search for HTML tags. - * @param $version - * @param $chunk + * @param string $version + * @param string $chunk * @return array */ protected function sampleData( $version, $chunk ) { @@ -832,8 +832,8 @@ class IEContentAnalyzer { } /** - * @param $version - * @param $type + * @param string $version + * @param string|null $type * @return int|string */ protected function getDataFormat( $version, $type ) { diff --git a/includes/libs/mime/XmlTypeCheck.php b/includes/libs/mime/XmlTypeCheck.php index e48cf62346..ea7f9a6ca7 100644 --- a/includes/libs/mime/XmlTypeCheck.php +++ b/includes/libs/mime/XmlTypeCheck.php @@ -275,7 +275,7 @@ class XmlTypeCheck { /** * Get all of the attributes for an XMLReader's current node - * @param $r XMLReader + * @param XMLReader $r * @return array of attributes */ private function getAttributesArray( XMLReader $r ) { @@ -293,8 +293,8 @@ class XmlTypeCheck { } /** - * @param $name element or attribute name, maybe with a full or short prefix - * @param $namespaceURI the namespaceURI + * @param string $name element or attribute name, maybe with a full or short prefix + * @param string $namespaceURI the namespaceURI * @return string the name prefixed with namespaceURI */ private function expandNS( $name, $namespaceURI ) { @@ -307,8 +307,8 @@ class XmlTypeCheck { } /** - * @param $name - * @param $attribs + * @param string $name + * @param string $attribs */ private function elementOpen( $name, $attribs ) { $this->elementDataContext[] = [ $name, $attribs ]; @@ -338,7 +338,7 @@ class XmlTypeCheck { } /** - * @param $data + * @param string $data */ private function elementData( $data ) { // Collect any data here, and we'll run the callback in elementClose @@ -346,8 +346,8 @@ class XmlTypeCheck { } /** - * @param $target - * @param $data + * @param string $target + * @param string $data */ private function processingInstructionHandler( $target, $data ) { $callbackReturn = false; @@ -452,7 +452,7 @@ class XmlTypeCheck { * * If there is an error parsing the dtd, sets wellFormed to false. * - * @param $dtd string + * @param string $dtd * @return array Possibly containing keys publicid, systemid, type and internal. */ private function parseDTD( $dtd ) { diff --git a/includes/libs/rdbms/TransactionProfiler.php b/includes/libs/rdbms/TransactionProfiler.php index 43b6f88704..8ac41611a3 100644 --- a/includes/libs/rdbms/TransactionProfiler.php +++ b/includes/libs/rdbms/TransactionProfiler.php @@ -118,7 +118,7 @@ class TransactionProfiler implements LoggerAwareInterface { * With conflicting expectations, the most narrow ones will be used * * @param array $expects Map of (event => limit) - * @param $fname + * @param string $fname * @since 1.26 */ public function setExpectations( array $expects, $fname ) { diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 0726b5ab5a..7349b63a59 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -818,7 +818,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware } /** - * @param $sql + * @param string $sql * @return string|null */ protected function getQueryVerb( $sql ) { diff --git a/includes/libs/rdbms/encasing/Blob.php b/includes/libs/rdbms/encasing/Blob.php index db5b7e5113..e2d685cbb9 100644 --- a/includes/libs/rdbms/encasing/Blob.php +++ b/includes/libs/rdbms/encasing/Blob.php @@ -7,7 +7,7 @@ class Blob implements IBlob { protected $mData; /** - * @param $data string + * @param string $data */ public function __construct( $data ) { $this->mData = $data; diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index ee8888c3e0..502fce3ee7 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -913,11 +913,11 @@ abstract class MediaHandler { } /** - * Get useful response headers for GET/HEAD requests for a file with the given metadata - * @param $metadata Array Contains this handler's unserialized getMetadata() for a file - * @return Array - * @since 1.30 - */ + * Get useful response headers for GET/HEAD requests for a file with the given metadata + * @param array $metadata Contains this handler's unserialized getMetadata() for a file + * @return array + * @since 1.30 + */ public function getContentHeaders( $metadata ) { return []; } diff --git a/includes/media/WebP.php b/includes/media/WebP.php index 4555c198ae..541cac234c 100644 --- a/includes/media/WebP.php +++ b/includes/media/WebP.php @@ -245,7 +245,7 @@ class WebPHandler extends BitmapHandler { } /** - * @param $file + * @param File $file * @return bool True, not all browsers support WebP */ public function mustRender( $file ) { @@ -253,7 +253,7 @@ class WebPHandler extends BitmapHandler { } /** - * @param $file + * @param File $file * @return bool False if we are unable to render this image */ public function canRender( $file ) { @@ -286,9 +286,9 @@ class WebPHandler extends BitmapHandler { /** * Render files as PNG * - * @param $ext - * @param $mime - * @param $params + * @param string $ext + * @param string $mime + * @param array|null $params * @return array */ public function getThumbType( $ext, $mime, $params = null ) { diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index b870831e5f..0e3eaa5bcc 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -621,8 +621,8 @@ EOT /** * Make the text under the image to say what size preview * - * @param $params array parameters for thumbnail - * @param $sizeLinkBigImagePreview HTML for the current size + * @param array $params parameters for thumbnail + * @param string $sizeLinkBigImagePreview HTML for the current size * @return string HTML output */ private function getThumbPrevText( $params, $sizeLinkBigImagePreview ) { diff --git a/includes/search/NullIndexField.php b/includes/search/NullIndexField.php index 32f60bcc67..5ecf5c8929 100644 --- a/includes/search/NullIndexField.php +++ b/includes/search/NullIndexField.php @@ -26,7 +26,7 @@ class NullIndexField implements SearchIndexField { /** * Check if flag is set. - * @param $flag + * @param int $flag * @return int 0 if unset, !=0 if set */ public function checkFlag( $flag ) { diff --git a/includes/search/SearchIndexField.php b/includes/search/SearchIndexField.php index a348d6dc9a..eb72662508 100644 --- a/includes/search/SearchIndexField.php +++ b/includes/search/SearchIndexField.php @@ -61,7 +61,7 @@ interface SearchIndexField { public function setFlag( $flag, $unset = false ); /** * Check if flag is set. - * @param $flag + * @param int $flag * @return int 0 if unset, !=0 if set */ public function checkFlag( $flag ); diff --git a/includes/search/SearchIndexFieldDefinition.php b/includes/search/SearchIndexFieldDefinition.php index 9a637d85c2..3e008ae66a 100644 --- a/includes/search/SearchIndexFieldDefinition.php +++ b/includes/search/SearchIndexFieldDefinition.php @@ -81,7 +81,7 @@ abstract class SearchIndexFieldDefinition implements SearchIndexField { /** * Check if flag is set. - * @param $flag + * @param int $flag * @return int 0 if unset, !=0 if set */ public function checkFlag( $flag ) { diff --git a/includes/site/SiteImporter.php b/includes/site/SiteImporter.php index 42812e14fb..5e13d06152 100644 --- a/includes/site/SiteImporter.php +++ b/includes/site/SiteImporter.php @@ -191,7 +191,7 @@ class SiteImporter { /** * @param DOMElement $element - * @param $name + * @param string $name * @param string|null|bool $default * * @return null|string diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index 9b77b73dc0..500c2e93f5 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -474,7 +474,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { /** * Submit handler callback for HTMLForm * @private - * @param $data array Submitted data + * @param array $data Submitted data * @return Status */ public function handleFormSubmit( $data ) { @@ -598,7 +598,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { /** * Adds a sequential tabindex starting from 1 to all form elements. This way the user can * use the tab key to traverse the form without having to step through all links and such. - * @param $formDescriptor + * @param array &$formDescriptor */ protected function addTabIndex( &$formDescriptor ) { $i = 1; diff --git a/includes/specialpage/LoginSignupSpecialPage.php b/includes/specialpage/LoginSignupSpecialPage.php index 2dccee1f8c..28277bceba 100644 --- a/includes/specialpage/LoginSignupSpecialPage.php +++ b/includes/specialpage/LoginSignupSpecialPage.php @@ -98,7 +98,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { /** * Load basic request parameters for this Special page. - * @param $subPage + * @param string $subPage */ private function loadRequestParameters( $subPage ) { if ( $this->mLoadedRequest ) { @@ -1199,7 +1199,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { /** * Adds fields provided via the deprecated UserLoginForm / UserCreateForm hooks - * @param $fieldDefinitions array + * @param array $fieldDefinitions * @param FakeAuthTemplate $template * @return array */ diff --git a/includes/specials/pagers/ProtectedPagesPager.php b/includes/specials/pagers/ProtectedPagesPager.php index 45dced8829..823b5da403 100644 --- a/includes/specials/pagers/ProtectedPagesPager.php +++ b/includes/specials/pagers/ProtectedPagesPager.php @@ -36,9 +36,9 @@ class ProtectedPagesPager extends TablePager { /** * @param SpecialProtectedpages $form * @param array $conds - * @param $type - * @param $level - * @param $namespace + * @param string $type + * @param string $level + * @param int $namespace * @param string $sizetype * @param int $size * @param bool $indefonly diff --git a/languages/Language.php b/languages/Language.php index 92dad9b134..e8d296925f 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -203,7 +203,7 @@ class Language { /** * Create a language object for a given language code * @param string $code - * @param $fallback boolean Whether we're going through language fallback chain + * @param bool $fallback Whether we're going through language fallback chain * @throws MWException * @return Language */ diff --git a/languages/classes/LanguageEn.php b/languages/classes/LanguageEn.php index dcb7a9194b..1cfcd2c74e 100644 --- a/languages/classes/LanguageEn.php +++ b/languages/classes/LanguageEn.php @@ -36,8 +36,8 @@ class EnConverter extends LanguageConverter { * Translates text into Pig Latin. This allows developers to test the language variants * functionality and user interface without having to switch wiki language away from default. * - * @param $text string - * @param $toVariant string + * @param string $text + * @param string $toVariant * @return string */ function translate( $text, $toVariant ) { diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index f694f3984c..c2f396be8d 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -1529,7 +1529,7 @@ class ParserTestRunner { /** * Add articles to the test DB. * - * @param $articles Article info array from TestFileReader + * @param array $articles Article info array from TestFileReader */ public function addArticles( $articles ) { global $wgContLang; diff --git a/tests/phpunit/includes/WatchedItemQueryServiceUnitTest.php b/tests/phpunit/includes/WatchedItemQueryServiceUnitTest.php index 958d70acd2..474487520a 100644 --- a/tests/phpunit/includes/WatchedItemQueryServiceUnitTest.php +++ b/tests/phpunit/includes/WatchedItemQueryServiceUnitTest.php @@ -49,7 +49,7 @@ class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase { } /** - * @param $mockDb + * @param PHPUnit_Framework_MockObject_MockObject|Database $mockDb * @return PHPUnit_Framework_MockObject_MockObject|LoadBalancer */ private function getMockLoadBalancer( $mockDb ) { diff --git a/tests/phpunit/includes/WatchedItemStoreUnitTest.php b/tests/phpunit/includes/WatchedItemStoreUnitTest.php index 6c1859921c..950e220845 100644 --- a/tests/phpunit/includes/WatchedItemStoreUnitTest.php +++ b/tests/phpunit/includes/WatchedItemStoreUnitTest.php @@ -2030,7 +2030,7 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase { } /** - * @param $text + * @param string $text * @param int $ns * * @return PHPUnit_Framework_MockObject_MockObject|Title diff --git a/tests/phpunit/includes/content/WikitextStructureTest.php b/tests/phpunit/includes/content/WikitextStructureTest.php index 49907c8532..f1b54f6abe 100644 --- a/tests/phpunit/includes/content/WikitextStructureTest.php +++ b/tests/phpunit/includes/content/WikitextStructureTest.php @@ -8,7 +8,7 @@ class WikitextStructureTest extends MediaWikiLangTestCase { /** * Get parser output for Wiki text - * @param $text + * @param string $text * @return ParserOutput */ private function getParserOutput( $text ) { @@ -18,7 +18,7 @@ class WikitextStructureTest extends MediaWikiLangTestCase { /** * Get WikitextStructure for given text - * @param $text + * @param string $text * @return WikiTextStructure */ private function getStructure( $text ) { diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php index 9c4c9be2f9..58a6d38167 100644 --- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php @@ -912,7 +912,7 @@ class WANObjectCacheTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getWithSetCallback_versions_provider * @param array $extOpts - * @param $versioned + * @param bool $versioned */ public function testGetWithSetCallback_versions( array $extOpts, $versioned ) { $cache = $this->cache; diff --git a/tests/phpunit/includes/search/SearchIndexFieldTest.php b/tests/phpunit/includes/search/SearchIndexFieldTest.php index bb7508c1c8..8b4119e0d3 100644 --- a/tests/phpunit/includes/search/SearchIndexFieldTest.php +++ b/tests/phpunit/includes/search/SearchIndexFieldTest.php @@ -18,11 +18,11 @@ class SearchIndexFieldTest extends MediaWikiTestCase { /** * @dataProvider getMergeCases - * @param $t1 - * @param $n1 - * @param $t2 - * @param $n2 - * @param $result + * @param int $t1 + * @param string $n1 + * @param int $t2 + * @param string $n2 + * @param bool $result */ public function testMerge( $t1, $n1, $t2, $n2, $result ) { $field1 =