/**
* Add new field definition to array.
* @param SearchIndexField[] &$fields
- * @param SearchEngine $engine
- * @param string $name
- * @param int $type
+ * @param SearchEngine $engine
+ * @param string $name
+ * @param int $type
* @return SearchIndexField[] new field defs
* @since 1.28
*/
* as representation of this document.
* Overriding class should call parent function or take care of calling
* the SearchDataForIndex hook.
- * @param WikiPage $page Page to index
+ * @param WikiPage $page Page to index
* @param ParserOutput $output
* @param SearchEngine $engine Search engine for which we are indexing
* @return array Map of name=>value for fields
*
* Specific content handlers may override it if they need different content handling.
*
- * @param WikiPage $page
+ * @param WikiPage $page
* @param ParserCache $cache
* @return ParserOutput
*/
* Returns the content's text as-is.
*
* @param Content $content
- * @param string $format The serialization format to check
+ * @param string $format The serialization format to check
*
* @return mixed
*/
}
/**
- * Log to a file without getting "file size exceeded" signals.
- *
- * Can also log to UDP with the syntax udp://host:port/prefix. This will send
- * lines to the specified port, prefixed by the specified prefix and a space.
- *
- * @param string $text
- * @param string $file Filename
- */
+ * Log to a file without getting "file size exceeded" signals.
+ *
+ * Can also log to UDP with the syntax udp://host:port/prefix. This will send
+ * lines to the specified port, prefixed by the specified prefix and a space.
+ *
+ * @param string $text
+ * @param string $file Filename
+ */
public static function emit( $text, $file ) {
if ( substr( $file, 0, 4 ) == 'udp:' ) {
$transport = UDPTransport::newFromString( $file );
* @param ErrorException $e
* @param string $channel
* @param string $level
- */
+ */
protected static function logError(
ErrorException $e, $channel, $level = LogLevel::ERROR
) {
return $this->url;
}
- /*
+ /**
* Get short description URL for a files based on the page ID
*
* @return string|null
}
/**
- * @return int
- */
+ * @return int
+ */
function getBitDepth() {
$gis = $this->getImageSize( $this->getLocalRefPath() );
}
/**
- * @param string $key
+ * @param string $key
* @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
* @return mixed Returns false on failure and if the item does not exist
*/
/**
* Handle storage error
* @param string $msg Error message
- * @param int $rcode Error code from client
+ * @param int $rcode Error code from client
* @param string $rerr Error message from client
* @return false
*/
* Set an item
*
* @param string $key
- * @param mixed $value
- * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
- * @param int $flags Bitfield of BagOStuff::WRITE_* constants
+ * @param mixed $value
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $flags Bitfield of BagOStuff::WRITE_* constants
* @return bool Success
*/
public function set( $key, $value, $exptime = 0, $flags = 0 ) {
* This function creates a 'increment' StatsdData object.
*
* @param string|array $key The metric(s) to increment.
- * @param float|1 $sampleRate The rate (0-1) for sampling.
*
* @return array
*/
*
*
* @param string|array $key The metric(s) to decrement.
- * @param float|1 $sampleRate The rate (0-1) for sampling.
*
* @return mixed
*/
* @param Array $pagesByDimensions
* @return String
* @since 1.30
- */
+ */
public static function getPageRangesByDimensions( $pagesByDimensions ) {
$pageRangesByDimensions = [];
*
* @since 1.19
* @param ParserOptions $parserOptions ParserOptions to use for the parse operation
- * @param null|int $oldid Revision ID to get the text from, passing null or 0 will
- * get the current revision (default value)
- * @param bool $forceParse Force reindexing, regardless of cache settings
+ * @param null|int $oldid Revision ID to get the text from, passing null or 0 will
+ * get the current revision (default value)
+ * @param bool $forceParse Force reindexing, regardless of cache settings
* @return bool|ParserOutput ParserOutput or false if the revision was not found
*/
public function getParserOutput(
return $this->getTitle()->getCanonicalURL();
}
- /*
+ /**
* @param WANObjectCache $cache
* @return string[]
* @since 1.28
}
/**
- * @param ResourceLoaderContext $context
- * @return array
- */
+ * @param ResourceLoaderContext $context
+ * @return array
+ */
public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
// Bypass file module urls
return ResourceLoaderModule::getScriptURLsForDebug( $context );
/**
* Set global flag for this field.
*
- * @param int $flag Bit flag to set/unset
+ * @param int $flag Bit flag to set/unset
* @param bool $unset True if flag should be unset, false by default
* @return $this
*/
* Create a search field definition.
* Specific search engines should override this method to create search fields.
* @param string $name
- * @param int $type One of the types in SearchIndexField::INDEX_TYPE_*
+ * @param int $type One of the types in SearchIndexField::INDEX_TYPE_*
* @return SearchIndexField
* @since 1.28
*/
* This field is case-insensitive.
*/
const FLAG_CASEFOLD = 1;
+
/**
* This field contains secondary information, which is
* already present in other fields, but can be used for
* scoring.
*/
const FLAG_SCORING = 2;
+
/**
* This field does not need highlight handling.
*/
const FLAG_NO_HIGHLIGHT = 4;
+
/**
* Do not index this field, just store it.
*/
* @return array|null Null means this field does not map to anything
*/
public function getMapping( SearchEngine $engine );
+
/**
* Set global flag for this field.
*
- * @param int $flag Bit flag to set/unset
+ * @param int $flag Bit flag to set/unset
* @param bool $unset True if flag should be unset, false by default
* @return $this
*/
public function setFlag( $flag, $unset = false );
+
/**
* Check if flag is set.
* @param int $flag
* @return int 0 if unset, !=0 if set
*/
public function checkFlag( $flag );
+
/**
* Merge two field definitions if possible.
*
* @since 1.28
*/
abstract class SearchIndexFieldDefinition implements SearchIndexField {
+
/**
* Name of the field
*
* @var string
*/
protected $name;
+
/**
* Type of the field, one of the constants above
*
* @var int
*/
protected $type;
+
/**
* Bit flags for the field.
*
* @var int
*/
protected $flags = 0;
+
/**
* Subfields
* @var SearchIndexFieldDefinition[]
/**
* @param string $name Field name
- * @param int $type Index type
+ * @param int $type Index type
*/
public function __construct( $name, $type ) {
$this->name = $name;
/**
* Set global flag for this field.
*
- * @param int $flag Bit flag to set/unset
+ * @param int $flag Bit flag to set/unset
* @param bool $unset True if flag should be unset, false by default
* @return $this
*/
/**
* Return a new SearchResult and initializes it with a title.
*
- * @param Title $title
+ * @param Title $title
* @param SearchResultSet $parentSet
* @return SearchResult
*/
}
/**
- * extends the value of data with name $name with the value $value
- * @since 1.25
- * @param string $name
- * @param mixed $value
- */
+ * extends the value of data with name $name with the value $value
+ * @since 1.25
+ * @param string $name
+ * @param mixed $value
+ */
public function extend( $name, $value ) {
if ( $this->haveData( $name ) ) {
$this->data[$name] = $this->data[$name] . $value;
*/
class MediaStatisticsPage extends QueryPage {
protected $totalCount = 0, $totalBytes = 0;
+
/**
- * @var integer $totalPerType Combined file size of all files in a section
- */
+ * @var integer $totalPerType Combined file size of all files in a section
+ */
protected $totalPerType = 0;
+
/**
- * @var integer $totalSize Combined file size of all files
- */
+ * @var integer $totalSize Combined file size of all files
+ */
protected $totalSize = 0;
function __construct( $name = 'MediaStatistics' ) {
protected $output;
/**
- * @param BatchRowIterator $reader Iterator that returns an
+ * @param BatchRowIterator $reader Iterator that returns an
* array of database rows
- * @param BatchRowWriter $writer Writer capable of pushing
+ * @param BatchRowWriter $writer Writer capable of pushing
* row updates to the database
* @param RowUpdateGenerator $generator Generates single row updates
* based on the rows content
/**
* @param IDatabase $db The database to write to
- * @param string $table The name of the table to update
- * @param string|bool $clusterName A cluster name valid for use with LBFactory
+ * @param string $table The name of the table to update
+ * @param string|bool $clusterName A cluster name valid for use with LBFactory
*/
public function __construct( IDatabase $db, $table, $clusterName = false ) {
$this->db = $db;
<ruleset name="MediaWiki">
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="Generic.ControlStructures.InlineControlStructure" />
- <!-- Disable rules added in 0.8.0 that don't pass yet -->
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
- <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Protected" />
- <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Public" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
- <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfterParamName" />
- <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfterParamType" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.NotShortBoolReturn" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.NotShortIntReturn" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.NotShortBoolParam" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.NotShortIntParam" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
+ <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
<exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
*
* @return Database[] Array of Database master connections
*/
-
protected static function getExternalStoreDatabaseConnections() {
global $wgDefaultExternalStore;