}
/**
- * @param $maxage
+ * @param int $maxage
* @deprecated since 1.27 Use setCdnMaxage() instead
*/
public function setSquidMaxage( $maxage ) {
/**
* 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 ) {
/**
* 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 ) ) {
/**
* 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' );
/**
* 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 = '';
/**
* 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 ) {
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.
*
* 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();
/**
* @param string $text JSON
+ * @param string $modelId
*/
public function __construct( $text, $modelId = CONTENT_MODEL_JSON ) {
parent::__construct( $text, $modelId );
* changes.
*
* @since 1.28
- * @param $text
+ * @param string $text
* @return string
*/
public static function normalizeLineEndings( $text ) {
}
/**
- * @param $dir
- * @param $db
+ * @param string $dir
+ * @param string $db
* @return Status
*/
protected function makeStubDBFile( $dir, $db ) {
/**
* 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 = [] ) {
* 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 ) {
/**
* 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 ) {
/**
* 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 ) {
/**
* 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 ) {
/**
* 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 ) {
/**
* 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 ) {
}
/**
- * @param $version
- * @param $type
+ * @param string $version
+ * @param string|null $type
* @return int|string
*/
protected function getDataFormat( $version, $type ) {
/**
* 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 ) {
}
/**
- * @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 ) {
}
/**
- * @param $name
- * @param $attribs
+ * @param string $name
+ * @param string $attribs
*/
private function elementOpen( $name, $attribs ) {
$this->elementDataContext[] = [ $name, $attribs ];
}
/**
- * @param $data
+ * @param string $data
*/
private function elementData( $data ) {
// Collect any data here, and we'll run the callback in elementClose
}
/**
- * @param $target
- * @param $data
+ * @param string $target
+ * @param string $data
*/
private function processingInstructionHandler( $target, $data ) {
$callbackReturn = false;
*
* 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 ) {
* 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 ) {
}
/**
- * @param $sql
+ * @param string $sql
* @return string|null
*/
protected function getQueryVerb( $sql ) {
protected $mData;
/**
- * @param $data string
+ * @param string $data
*/
public function __construct( $data ) {
$this->mData = $data;
}
/**
- * 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 [];
}
}
/**
- * @param $file
+ * @param File $file
* @return bool True, not all browsers support WebP
*/
public function mustRender( $file ) {
}
/**
- * @param $file
+ * @param File $file
* @return bool False if we are unable to render this image
*/
public function canRender( $file ) {
/**
* 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 ) {
/**
* 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 ) {
/**
* Check if flag is set.
- * @param $flag
+ * @param int $flag
* @return int 0 if unset, !=0 if set
*/
public function checkFlag( $flag ) {
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 );
/**
* Check if flag is set.
- * @param $flag
+ * @param int $flag
* @return int 0 if unset, !=0 if set
*/
public function checkFlag( $flag ) {
/**
* @param DOMElement $element
- * @param $name
+ * @param string $name
* @param string|null|bool $default
*
* @return null|string
/**
* Submit handler callback for HTMLForm
* @private
- * @param $data array Submitted data
+ * @param array $data Submitted data
* @return Status
*/
public function handleFormSubmit( $data ) {
/**
* 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;
/**
* Load basic request parameters for this Special page.
- * @param $subPage
+ * @param string $subPage
*/
private function loadRequestParameters( $subPage ) {
if ( $this->mLoadedRequest ) {
/**
* Adds fields provided via the deprecated UserLoginForm / UserCreateForm hooks
- * @param $fieldDefinitions array
+ * @param array $fieldDefinitions
* @param FakeAuthTemplate $template
* @return array
*/
/**
* @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
/**
* 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
*/
* 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 ) {
/**
* 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;
}
/**
- * @param $mockDb
+ * @param PHPUnit_Framework_MockObject_MockObject|Database $mockDb
* @return PHPUnit_Framework_MockObject_MockObject|LoadBalancer
*/
private function getMockLoadBalancer( $mockDb ) {
}
/**
- * @param $text
+ * @param string $text
* @param int $ns
*
* @return PHPUnit_Framework_MockObject_MockObject|Title
/**
* Get parser output for Wiki text
- * @param $text
+ * @param string $text
* @return ParserOutput
*/
private function getParserOutput( $text ) {
/**
* Get WikitextStructure for given text
- * @param $text
+ * @param string $text
* @return WikiTextStructure
*/
private function getStructure( $text ) {
/**
* @dataProvider getWithSetCallback_versions_provider
* @param array $extOpts
- * @param $versioned
+ * @param bool $versioned
*/
public function testGetWithSetCallback_versions( array $extOpts, $versioned ) {
$cache = $this->cache;
/**
* @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 =