Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
43 files changed:
/**
* Button cannot be invalid
*
/**
* Button cannot be invalid
*
- * @param $value String
- * @param $alldata Array
+ * @param string $value
+ * @param array $alldata
*/
public function validate( $value, $alldata ) {
return true;
*/
public function validate( $value, $alldata ) {
return true;
/**
* For a checkbox, the label goes on the right hand side, and is
* added in getInputHTML(), rather than HTMLFormField::getRow()
/**
* For a checkbox, the label goes on the right hand side, and is
* added in getInputHTML(), rather than HTMLFormField::getRow()
*/
function getLabel() {
return ' ';
*/
function getLabel() {
return ' ';
/**
* checkboxes don't need a label.
/**
* checkboxes don't need a label.
*/
protected function needsLabel() {
return false;
}
/**
*/
protected function needsLabel() {
return false;
}
/**
- * @param $request WebRequest
+ * @param WebRequest $request
*/
function loadDataFromRequest( $request ) {
$invert = false;
*/
function loadDataFromRequest( $request ) {
$invert = false;
* mParams['rows'] is an array with row labels as keys and row tags as values.
* mParams['columns'] is an array with column labels as keys and column tags as values.
*
* mParams['rows'] is an array with row labels as keys and row tags as values.
* mParams['columns'] is an array with column labels as keys and column tags as values.
*
- * @param array $value of the options that should be checked
+ * @param array $value Array of the options that should be checked
*/
function getInputHTML( $value ) {
$html = '';
*/
function getInputHTML( $value ) {
$html = '';
* line above the options in the case of a checkbox matrix, i.e. it's always
* a "vertical-label".
*
* line above the options in the case of a checkbox matrix, i.e. it's always
* a "vertical-label".
*
- * @param string $value the value to set the input to
+ * @param string $value The value to set the input to
- * @return String complete HTML table row
+ * @return string Complete HTML table row
*/
function getTableRow( $value ) {
list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value );
*/
function getTableRow( $value ) {
list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value );
- * @param $request WebRequest
+ * @param WebRequest $request
*/
function loadDataFromRequest( $request ) {
if ( $this->mParent->getMethod() == 'post' ) {
*/
function loadDataFromRequest( $request ) {
if ( $this->mParent->getMethod() == 'post' ) {
/**
* Format in which to display form. For viable options,
* @see $availableDisplayFormats
/**
* Format in which to display form. For viable options,
* @see $availableDisplayFormats
*/
protected $displayFormat = 'table';
/**
* Available formats in which to display the form
*/
protected $displayFormat = 'table';
/**
* Available formats in which to display the form
*/
protected $availableDisplayFormats = array(
'table',
*/
protected $availableDisplayFormats = array(
'table',
/**
* Build a new HTMLForm from an array of field attributes
*
/**
* Build a new HTMLForm from an array of field attributes
*
- * @param array $descriptor of Field constructs, as described above
- * @param $context IContextSource available since 1.18, will become compulsory in 1.18.
+ * @param array $descriptor Array of Field constructs, as described above
+ * @param IContextSource $context Available since 1.18, will become compulsory in 1.18.
* Obviates the need to call $form->setTitle()
* Obviates the need to call $form->setTitle()
- * @param string $messagePrefix a prefix to go in front of default messages
+ * @param string $messagePrefix A prefix to go in front of default messages
*/
public function __construct( $descriptor, /*IContextSource*/ $context = null,
$messagePrefix = ''
*/
public function __construct( $descriptor, /*IContextSource*/ $context = null,
$messagePrefix = ''
/**
* Set format in which to display the form
*
/**
* Set format in which to display the form
*
- * @param string $format the name of the format to use, must be one of
- * $this->availableDisplayFormats
+ * @param string $format The name of the format to use, must be one of
+ * $this->availableDisplayFormats
*
* @throws MWException
* @since 1.20
*
* @throws MWException
* @since 1.20
/**
* Getter for displayFormat
* @since 1.20
/**
* Getter for displayFormat
* @since 1.20
*/
public function getDisplayFormat() {
return $this->displayFormat;
*/
public function getDisplayFormat() {
return $this->displayFormat;
/**
* Test if displayFormat is 'vform'
* @since 1.22
/**
* Test if displayFormat is 'vform'
* @since 1.22
*/
public function isVForm() {
return $this->displayFormat === 'vform';
*/
public function isVForm() {
return $this->displayFormat === 'vform';
/**
* Try submitting, with edit token check first
/**
* Try submitting, with edit token check first
- * @return Status|boolean
*/
function tryAuthorizedSubmit() {
$result = false;
*/
function tryAuthorizedSubmit() {
$result = false;
* The here's-one-I-made-earlier option: do the submission if
* posted, or display the form with or without funky validation
* errors
* The here's-one-I-made-earlier option: do the submission if
* posted, or display the form with or without funky validation
* errors
- * @return Bool or Status whether submission was successful.
+ * @return bool|Status Whether submission was successful.
*/
function show() {
$this->prepareForm();
*/
function show() {
$this->prepareForm();
* Validate all the fields, and call the submission callback
* function if everything is kosher.
* @throws MWException
* Validate all the fields, and call the submission callback
* function if everything is kosher.
* @throws MWException
- * @return Mixed Bool true == Successful submission, Bool false
+ * @return mixed Bool true == Successful submission, Bool false
* == No submission attempted, anything else == Error to
* display.
*/
* == No submission attempted, anything else == Error to
* display.
*/
* Set a callback to a function to do something with the form
* once it's been successfully validated.
*
* Set a callback to a function to do something with the form
* once it's been successfully validated.
*
- * @param string $cb function name. The function will be passed
+ * @param string $cb Function name. The function will be passed
* the output from HTMLForm::filterDataForSubmit, and must
* return Bool true on success, Bool false if no submission
* was attempted, or String HTML output to display on error.
* the output from HTMLForm::filterDataForSubmit, and must
* return Bool true on success, Bool false if no submission
* was attempted, or String HTML output to display on error.
/**
* Set a message to display on a validation error.
*
/**
* Set a message to display on a validation error.
*
- * @param $msg Mixed String or Array of valid inputs to wfMessage()
+ * @param string|array $msg String or Array of valid inputs to wfMessage()
* (so each entry can be either a String or Array)
*
* @return HTMLForm $this for chaining calls (since 1.20)
* (so each entry can be either a String or Array)
*
* @return HTMLForm $this for chaining calls (since 1.20)
/**
* Set the introductory message, overwriting any existing message.
*
/**
* Set the introductory message, overwriting any existing message.
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* Set the introductory message, overwriting any existing message.
* @since 1.19
*
* Set the introductory message, overwriting any existing message.
* @since 1.19
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Add introductory text.
*
/**
* Add introductory text.
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Add header text, inside the form.
*
/**
* Add header text, inside the form.
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
* @param string $section The section to add the header to
*
* @return HTMLForm $this for chaining calls (since 1.20)
* @param string $section The section to add the header to
*
* @return HTMLForm $this for chaining calls (since 1.20)
* Set header text, inside the form.
* @since 1.19
*
* Set header text, inside the form.
* @since 1.19
*
- * @param string $msg complete text of message to display
- * @param $section The section to add the header to
+ * @param string $msg Complete text of message to display
+ * @param string $section The section to add the header to
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* Set footer text, inside the form.
* @since 1.19
*
* Set footer text, inside the form.
* @since 1.19
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
* @param string $section The section to add the footer text to
*
* @return HTMLForm $this for chaining calls (since 1.20)
* @param string $section The section to add the footer text to
*
* @return HTMLForm $this for chaining calls (since 1.20)
/**
* Add text to the end of the display.
*
/**
* Add text to the end of the display.
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Set text at the end of the display.
*
/**
* Set text at the end of the display.
*
- * @param string $msg complete text of message to display
+ * @param string $msg Complete text of message to display
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Add a hidden field to the output
*
/**
* Add a hidden field to the output
*
- * @param string $name field name. This will be used exactly as entered
- * @param string $value field value
- * @param $attribs Array
+ * @param string $name Field name. This will be used exactly as entered
+ * @param string $value Field value
+ * @param array $attribs
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Add a button to the form
*
/**
* Add a button to the form
*
- * @param string $name field name.
- * @param string $value field value
+ * @param string $name Field name.
+ * @param string $value Field value
* @param string $id DOM id for the button (default: null)
* @param string $id DOM id for the button (default: null)
- * @param $attribs Array
+ * @param array $attribs
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* Moreover, when doing method chaining this should be the very last method
* call just after prepareForm().
*
* Moreover, when doing method chaining this should be the very last method
* call just after prepareForm().
*
- * @param $submitResult Mixed output from HTMLForm::trySubmit()
+ * @param mixed $submitResult Mixed output from HTMLForm::trySubmit()
*
* @return Nothing, should be last call
*/
*
* @return Nothing, should be last call
*/
/**
* Returns the raw HTML generated by the form
*
/**
* Returns the raw HTML generated by the form
*
- * @param $submitResult Mixed output from HTMLForm::trySubmit()
+ * @param mixed $submitResult Mixed output from HTMLForm::trySubmit()
*
* @param string $html HTML contents to wrap.
*
*
* @param string $html HTML contents to wrap.
*
- * @return String wrapped HTML.
+ * @return string Wrapped HTML.
*/
function wrapForm( $html ) {
*/
function wrapForm( $html ) {
/**
* Get the hidden fields that should go inside the form.
/**
* Get the hidden fields that should go inside the form.
*/
function getHiddenFields() {
global $wgArticlePath;
*/
function getHiddenFields() {
global $wgArticlePath;
/**
* Get the submit and (potentially) reset buttons.
/**
* Get the submit and (potentially) reset buttons.
*/
function getButtons() {
$buttons = '';
*/
function getButtons() {
$buttons = '';
/**
* Get the whole body of the form.
/**
* Get the whole body of the form.
*/
function getBody() {
return $this->displaySection( $this->mFieldTree, $this->mTableId );
*/
function getBody() {
return $this->displaySection( $this->mFieldTree, $this->mTableId );
/**
* Format and display an error message stack.
*
/**
* Format and display an error message stack.
*
- * @param $errors String|Array|Status
+ * @param string|array|Status $errors
*/
function getErrors( $errors ) {
if ( $errors instanceof Status ) {
*/
function getErrors( $errors ) {
if ( $errors instanceof Status ) {
*
* @param array $errors of message keys/values
*
*
* @param array $errors of message keys/values
*
- * @return String HTML, a "<ul>" list of errors
+ * @return string HTML, a "<ul>" list of errors
*/
public static function formatErrors( $errors ) {
$errorstr = '';
*/
public static function formatErrors( $errors ) {
$errorstr = '';
* Set the text for the submit button to a message
* @since 1.19
*
* Set the text for the submit button to a message
* @since 1.19
*
- * @param string $msg message key
+ * @param string $msg Message key
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Set the id for the submit button.
*
/**
* Set the id for the submit button.
*
*
* @todo FIXME: Integrity of $t is *not* validated
* @return HTMLForm $this for chaining calls (since 1.20)
*
* @todo FIXME: Integrity of $t is *not* validated
* @return HTMLForm $this for chaining calls (since 1.20)
- * @param string $id new value of the id attribute, or "" to remove
+ * @param string $id New value of the id attribute, or "" to remove
*
* @return HTMLForm $this for chaining calls
*/
*
* @return HTMLForm $this for chaining calls
*/
* this message as its "<legend>" element.
* @since 1.19
*
* this message as its "<legend>" element.
* @since 1.19
*
- * @param string $msg message key
+ * @param string $msg Message key
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* @todo Currently only used for the "<fieldset>" legend on forms
* with multiple sections; should be used elsewhere?
*
* @todo Currently only used for the "<fieldset>" legend on forms
* with multiple sections; should be used elsewhere?
*
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Set the title for form submission
*
/**
* Set the title for form submission
*
- * @param $t Title of page the form is on/should be posted to
+ * @param Title $t Title of page the form is on/should be posted to
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Set the method used to submit the form
*
/**
* Set the method used to submit the form
*
- * @param $method String
+ * @param string $method
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* section, ignored if empty.
* @param string $fieldsetIDPrefix ID prefix for the "<fieldset>" tag of
* each subsection, ignored if empty.
* section, ignored if empty.
* @param string $fieldsetIDPrefix ID prefix for the "<fieldset>" tag of
* each subsection, ignored if empty.
- * @param boolean &$hasUserVisibleFields Whether the section had user-visible fields.
+ * @param bool &$hasUserVisibleFields Whether the section had user-visible fields.
*/
public function displaySection( $fields,
$sectionName = '',
*/
public function displaySection( $fields,
$sectionName = '',
/**
* Stop a reset button being shown for this form
*
/**
* Stop a reset button being shown for this form
*
- * @param bool $suppressReset set to false to re-enable the
- * button again
+ * @param bool $suppressReset Set to false to re-enable the button again
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* to the form as a whole, after it's submitted but before it's
* processed.
*
* to the form as a whole, after it's submitted but before it's
* processed.
*
* Get a string to go in the "<legend>" of a section fieldset.
* Override this if you want something more complicated.
*
* Get a string to go in the "<legend>" of a section fieldset.
* Override this if you want something more complicated.
*
*/
public function getLegend( $key ) {
return $this->msg( "{$this->mMessagePrefix}-$key" )->text();
*/
public function getLegend( $key ) {
return $this->msg( "{$this->mMessagePrefix}-$key" )->text();
*
* Parameters are the same as wfMessage().
*
*
* Parameters are the same as wfMessage().
*
- * @return Message object
*/
function msg() {
$args = func_get_args();
*/
function msg() {
$args = func_get_args();
* @param string $value The value the field was submitted with
* @param array $alldata The data collected from the form
*
* @param string $value The value the field was submitted with
* @param array $alldata The data collected from the form
*
- * @return Mixed Bool true on success, or String error to display.
+ * @return bool|string true on success, or String error to display.
*/
function validate( $value, $alldata ) {
if ( isset( $this->mParams['required'] )
*/
function validate( $value, $alldata ) {
if ( isset( $this->mParams['required'] )
* or the input's default value if it has not been set.
*
* @param WebRequest $request
* or the input's default value if it has not been set.
*
* @param WebRequest $request
- * @return String the value
+ * @return string The value
*/
function loadDataFromRequest( $request ) {
if ( $request->getCheck( $this->mName ) ) {
*/
function loadDataFromRequest( $request ) {
if ( $request->getCheck( $this->mName ) ) {
*
* @param string|null $helptext
*
*
* @param string|null $helptext
*
*/
public function getHelpTextHtmlDiv( $helptext ) {
if ( is_null( $helptext ) ) {
*/
public function getHelpTextHtmlDiv( $helptext ) {
if ( is_null( $helptext ) ) {
* @since 1.20
*
* @param string|null $helptext
* @since 1.20
*
* @param string|null $helptext
*/
public function getHelpTextHtmlRaw( $helptext ) {
return $this->getHelpTextHtmlDiv( $helptext );
*/
public function getHelpTextHtmlRaw( $helptext ) {
return $this->getHelpTextHtmlDiv( $helptext );
* flatten an array of options to a single array, for instance,
* a set of "<options>" inside "<optgroups>".
*
* flatten an array of options to a single array, for instance,
* a set of "<options>" inside "<optgroups>".
*
- * @param array $options Associative Array with values either Strings
- * or Arrays
+ * @param array $options Associative Array with values either Strings or Arrays
* @return array Flattened input
*/
public static function flattenOptions( $options ) {
* @return array Flattened input
*/
public static function flattenOptions( $options ) {
/**
* Formats one or more errors as accepted by field validation-callback.
*
/**
* Formats one or more errors as accepted by field validation-callback.
*
- * @param string|Message|array $errors String|Message|Array of strings or Message instances
+ * @param string|Message|array $errors Array of strings or Message instances
* @return string HTML
* @since 1.18
*/
* @return string HTML
* @since 1.18
*/
- * @param $request WebRequest
+ * @param WebRequest $request
*/
function loadDataFromRequest( $request ) {
if ( $this->mParent->getMethod() == 'post' ) {
*/
function loadDataFromRequest( $request ) {
if ( $this->mParent->getMethod() == 'post' ) {
* Support for seperating multi-option preferences into multiple preferences
* Due to lack of array support.
*
* Support for seperating multi-option preferences into multiple preferences
* Due to lack of array support.
*
*/
function filterDataForSubmit( $data );
}
*/
function filterDataForSubmit( $data );
}
* This returns a block of all the radio options, in one cell.
* @see includes/HTMLFormField#getInputHTML()
*
* This returns a block of all the radio options, in one cell.
* @see includes/HTMLFormField#getInputHTML()
*
*/
function getInputHTML( $value ) {
$html = $this->formatOptions( $this->getOptions(), strval( $value ) );
*/
function getInputHTML( $value ) {
$html = $this->formatOptions( $this->getOptions(), strval( $value ) );
- * @param $request WebRequest
+ * @param WebRequest $request
- * @return Array("<overall message>","<select value>","<text field value>")
+ * @return array("<overall message>","<select value>","<text field value>")
*/
function loadDataFromRequest( $request ) {
if ( $request->getCheck( $this->mName ) ) {
*/
function loadDataFromRequest( $request ) {
if ( $request->getCheck( $this->mName ) ) {
- * @param $request WebRequest
+ * @param WebRequest $request
*/
function loadDataFromRequest( $request ) {
if ( $request->getCheck( $this->mName ) ) {
*/
function loadDataFromRequest( $request ) {
if ( $request->getCheck( $this->mName ) ) {
* This may add duplicate at insert time, but they will be
* removed later on, when the first one is popped.
*
* This may add duplicate at insert time, but they will be
* removed later on, when the first one is popped.
*
- * @param array $jobs of Job objects
+ * @param array $jobs Array of Job objects
* @return bool
* @deprecated since 1.21
*/
* @return bool
* @deprecated since 1.21
*/
* be rolled-back as part of a larger transaction. However,
* large batches of jobs can cause slave lag.
*
* be rolled-back as part of a larger transaction. However,
* large batches of jobs can cause slave lag.
*
- * @param array $jobs of Job objects
+ * @param array $jobs Array of Job objects
* @return bool
* @deprecated since 1.21
*/
* @return bool
* @deprecated since 1.21
*/
* actually find a job; it may be adversely affected by concurrent job
* runners.
*
* actually find a job; it may be adversely affected by concurrent job
* runners.
*
* @return Job|bool Returns false if there are no jobs
* @deprecated since 1.21
*/
* @return Job|bool Returns false if there are no jobs
* @deprecated since 1.21
*/
*------------------------------------------------------------------------*/
/**
*------------------------------------------------------------------------*/
/**
- * @param $command
- * @param $title
- * @param $params array|bool
+ * @param string $command
+ * @param Title $title
+ * @param array|bool $params
*/
public function __construct( $command, $title, $params = false ) {
$this->command = $command;
*/
public function __construct( $command, $title, $params = false ) {
$this->command = $command;
- * @return integer Number of actually "work items" handled in this job
+ * @return int Number of actually "work items" handled in this job
* @see $wgJobBackoffThrottling
* @since 1.23
*/
* @see $wgJobBackoffThrottling
* @since 1.23
*/
/**
* @see JobQueue::batchPush()
* @param array $jobs
/**
* @see JobQueue::batchPush()
* @param array $jobs
*/
abstract protected function doBatchPush( array $jobs, $flags );
*/
abstract protected function doBatchPush( array $jobs, $flags );
/**
* @see JobQueue::doBatchPush()
* @param array $jobs
/**
* @see JobQueue::doBatchPush()
* @param array $jobs
* @throws DBError|Exception
* @return bool
*/
* @throws DBError|Exception
* @return bool
*/
* Reserve a row with a single UPDATE without holding row locks over RTTs...
*
* @param string $uuid 32 char hex string
* Reserve a row with a single UPDATE without holding row locks over RTTs...
*
* @param string $uuid 32 char hex string
- * @param $rand integer Random unsigned integer (31 bits)
+ * @param int $rand Random unsigned integer (31 bits)
* @param bool $gte Search for job_random >= $random (otherwise job_random <= $random)
* @return stdClass|bool Row|false
*/
* @param bool $gte Search for job_random >= $random (otherwise job_random <= $random)
* @return stdClass|bool Row|false
*/
- * @param $index integer (DB_SLAVE/DB_MASTER)
+ * @param int $index (DB_SLAVE/DB_MASTER)
* @return DBConnRef
*/
protected function getDB( $index ) {
* @return DBConnRef
*/
protected function getDB( $index ) {
+ * @param string $property
* @return string
*/
private function getCacheKey( $property ) {
* @return string
*/
private function getCacheKey( $property ) {
+ * @param array|bool $params
* @return string
*/
protected static function makeBlob( $params ) {
* @return string
*/
protected static function makeBlob( $params ) {
* @return bool|mixed
*/
protected static function extractBlob( $blob ) {
* @return bool|mixed
*/
protected static function extractBlob( $blob ) {
+ * @param string $property
* @return string
*/
private function getCacheKey( $property ) {
* @return string
*/
private function getCacheKey( $property ) {
/**
* Check if there are any queues with jobs (this is cached)
*
/**
* Check if there are any queues with jobs (this is cached)
*
- * @param integer $type JobQueueGroup::TYPE_* constant
+ * @param int $type JobQueueGroup::TYPE_* constant
* @return bool
* @since 1.23
*/
* @return bool
* @since 1.23
*/
* @return mixed
*/
private function getCachedConfigVar( $name ) {
* @return mixed
*/
private function getCachedConfigVar( $name ) {
/**
* @see JobQueue::doBatchPush()
* @param array $jobs
/**
* @see JobQueue::doBatchPush()
* @param array $jobs
* @return bool
* @throws JobQueueError
*/
* @return bool
* @throws JobQueueError
*/
/**
* @param RedisConnRef $conn
/**
* @param RedisConnRef $conn
- * @return array serialized string or false
+ * @return array Serialized string or false
* @throws RedisException
*/
protected function popAndDeleteBlob( RedisConnRef $conn ) {
* @throws RedisException
*/
protected function popAndDeleteBlob( RedisConnRef $conn ) {
/**
* @param RedisConnRef $conn
/**
* @param RedisConnRef $conn
- * @return array serialized string or false
+ * @return array Serialized string or false
* @throws RedisException
*/
protected function popAndAcquireBlob( RedisConnRef $conn ) {
* @throws RedisException
*/
protected function popAndAcquireBlob( RedisConnRef $conn ) {
/**
* This function should not be called outside JobQueueRedis
*
/**
* This function should not be called outside JobQueueRedis
*
- * @param $uid string
- * @param $conn RedisConnRef
+ * @param string $uid
+ * @param RedisConnRef $conn
* @return Job|bool Returns false if the job does not exist
* @throws MWException|JobQueueError
*/
* @return Job|bool Returns false if the job does not exist
* @throws MWException|JobQueueError
*/
* @return Job|bool
*/
protected function getJobFromFields( array $fields ) {
* @return Job|bool
*/
protected function getJobFromFields( array $fields ) {
- * @param $conn RedisConnRef
- * @param $e RedisException
+ * @param RedisConnRef $conn
+ * @param RedisException $e
* @throws JobQueueError
*/
protected function throwRedisException( RedisConnRef $conn, $e ) {
* @throws JobQueueError
*/
protected function throwRedisException( RedisConnRef $conn, $e ) {
- * @param $prop string
- * @param $type string|null
+ * @param string $prop
+ * @param string|null $type
* @return string
*/
private function getQueueKey( $prop, $type = null ) {
* @return string
*/
private function getQueueKey( $prop, $type = null ) {
* @return void
*/
public function setTestingPrefix( $key ) {
* @return void
*/
public function setTestingPrefix( $key ) {
/**
* Insert jobs into the job queue to fix redirects to the given title
/**
* Insert jobs into the job queue to fix redirects to the given title
- * @param string $reason the reason for the fix, see message
+ * @param string $reason The reason for the fix, see message
* "double-redirect-fixed-<reason>"
* "double-redirect-fixed-<reason>"
- * @param $redirTitle Title: the title which has changed, redirects
+ * @param Title $redirTitle The title which has changed, redirects
* pointing to this title are fixed
* @param bool $destTitle Not used
*/
* pointing to this title are fixed
* @param bool $destTitle Not used
*/
/**
* Get the final destination of a redirect
*
/**
* Get the final destination of a redirect
*
- * @return bool if the specified title is not a redirect, or if it is a circular redirect
+ * @return bool If the specified title is not a redirect, or if it is a circular redirect
*/
public static function getFinalDestination( $title ) {
$dbw = wfGetDB( DB_MASTER );
*/
public static function getFinalDestination( $title ) {
$dbw = wfGetDB( DB_MASTER );
/**
* Run a refreshLinks2 job
/**
* Run a refreshLinks2 job
- * @return boolean success
*/
function run() {
global $wgUpdateRowsPerJob;
*/
function run() {
global $wgUpdateRowsPerJob;
- * @param $table string
- * @param $masterPos mixed
- * @return Array
+ * @param string $table
+ * @param mixed $masterPos
+ * @return array
*/
protected function getSingleTitleJobs( $table, $masterPos ) {
# The "start"/"end" fields are not set for the base jobs
*/
protected function getSingleTitleJobs( $table, $masterPos ) {
# The "start"/"end" fields are not set for the base jobs
*/
public function getDeduplicationInfo() {
$info = parent::getDeduplicationInfo();
*/
public function getDeduplicationInfo() {
$info = parent::getDeduplicationInfo();
* @return mixed
*/
public static function &getSessionData( $key ) {
* @return mixed
*/
public static function &getSessionData( $key ) {
* @param array $info Module info array. For backwards compatibility with 1.17alpha,
* this may also be a ResourceLoaderModule object. Optional when using
* multiple-registration calling style.
* @param array $info Module info array. For backwards compatibility with 1.17alpha,
* this may also be a ResourceLoaderModule object. Optional when using
* multiple-registration calling style.
- * @throws MWException: If a duplicate module registration is attempted
- * @throws MWException: If a module name contains illegal characters (pipes or commas)
- * @throws MWException: If something other than a ResourceLoaderModule is being registered
- * @return boolean False if there were any errors, in which case one or more modules were
+ * @throws MWException If a duplicate module registration is attempted
+ * @throws MWException If a module name contains illegal characters (pipes or commas)
+ * @throws MWException If something other than a ResourceLoaderModule is being registered
+ * @return bool False if there were any errors, in which case one or more modules were
* not registered
*/
public function register( $name, $info = null ) {
* not registered
*/
public function register( $name, $info = null ) {
*
* @param string $framework Get only the test module names for one
* particular framework (optional)
*
* @param string $framework Get only the test module names for one
* particular framework (optional)
*/
public function getTestModuleNames( $framework = 'all' ) {
/// @todo api siteinfo prop testmodulenames modulenames
*/
public function getTestModuleNames( $framework = 'all' ) {
/// @todo api siteinfo prop testmodulenames modulenames
* If there's an If-Modified-Since header, respond with a 304 appropriately
* and clear out the output buffer. If the client cache is too old then do nothing.
*
* If there's an If-Modified-Since header, respond with a 304 appropriately
* and clear out the output buffer. If the client cache is too old then do nothing.
*
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @param string $mtime The TS_MW timestamp to check the header against
* @return bool True if 304 header sent and output handled
*/
* @param string $mtime The TS_MW timestamp to check the header against
* @return bool True if 304 header sent and output handled
*/
/**
* Handle exception display.
*
/**
* Handle exception display.
*
- * @param Exception $e to be shown to the user
- * @return string sanitized text that can be returned to the user
+ * @param Exception $e Exception to be shown to the user
+ * @return string Sanitized text that can be returned to the user
*/
public static function formatException( $e ) {
global $wgShowExceptionDetails;
*/
public static function formatException( $e ) {
global $wgShowExceptionDetails;
/**
* Generate code for a response.
*
/**
* Generate code for a response.
*
- * @param $context ResourceLoaderContext Context in which to generate a response
+ * @param ResourceLoaderContext $context Context in which to generate a response
* @param array $modules List of module objects keyed by module name
* @param array $missing List of requested module names that are unregistered (optional)
* @return string Response data
* @param array $modules List of module objects keyed by module name
* @param array $missing List of requested module names that are unregistered (optional)
* @return string Response data
* Set the state of modules with the given names to the given states
*
* @param string $name
* Set the state of modules with the given names to the given states
*
* @param string $name
* @return string
*/
public static function makeLoaderStateScript( $name, $state = null ) {
* @return string
*/
public static function makeLoaderStateScript( $name, $state = null ) {
* - ResourceLoader::makeLoaderSourcesScript( array( $id1 => $props1, $id2 => $props2, ... ) );
* Register sources with the given IDs and properties.
*
* - ResourceLoader::makeLoaderSourcesScript( array( $id1 => $props1, $id2 => $props2, ... ) );
* Register sources with the given IDs and properties.
*
- * @param string $id source ID
- * @param array $properties source properties (see addSource())
+ * @param string $id Source ID
+ * @param array $properties Source properties (see addSource())
* @return string
*/
public static function makeLoaderSourcesScript( $id, $properties = null ) {
* @return string
*/
public static function makeLoaderSourcesScript( $id, $properties = null ) {
/**
* Build a load.php URL
/**
* Build a load.php URL
- * @param array $modules of module names (strings)
+ * @param array $modules Array of module names (strings)
* @param string $lang Language code
* @param string $skin Skin name
* @param string|null $user User name. If null, the &user= parameter is omitted
* @param string $lang Language code
* @param string $skin Skin name
* @param string|null $user User name. If null, the &user= parameter is omitted
* Get global LESS variables.
*
* $since 1.22
* Get global LESS variables.
*
* $since 1.22
- * @return array: Map of variable names to string CSS values.
+ * @return array Map of variable names to string CSS values.
*/
public static function getLESSVars() {
global $wgResourceLoaderLESSVars;
*/
public static function getLESSVars() {
global $wgResourceLoaderLESSVars;
- * @param $resourceLoader ResourceLoader
- * @param $request WebRequest
+ * @param ResourceLoader $resourceLoader
+ * @param WebRequest $request
*/
public function __construct( $resourceLoader, WebRequest $request ) {
global $wgDefaultSkin, $wgResourceLoaderDebug;
*/
public function __construct( $resourceLoader, WebRequest $request ) {
global $wgDefaultSkin, $wgResourceLoaderDebug;
* an array of module names like array( 'jquery.foo', 'jquery.bar',
* 'jquery.ui.baz', 'jquery.ui.quux' )
* @param string $modules Packed module name list
* an array of module names like array( 'jquery.foo', 'jquery.bar',
* 'jquery.ui.baz', 'jquery.ui.quux' )
* @param string $modules Packed module name list
- * @return array of module names
+ * @return array Array of module names
*/
public static function expandModuleNames( $modules ) {
$retval = array();
*/
public static function expandModuleNames( $modules ) {
$retval = array();
*/
public function getOnly() {
return $this->only;
}
/**
*/
public function getOnly() {
return $this->only;
}
/**
*/
public function getVersion() {
return $this->version;
*/
public function getVersion() {
return $this->version;
- /** String: Local base path, see __construct() */
+ /** @var string Local base path, see __construct() */
protected $localBasePath = '';
protected $localBasePath = '';
- /** String: Remote base path, see __construct() */
+ /** @var string Remote base path, see __construct() */
protected $remoteBasePath = '';
/**
protected $remoteBasePath = '';
/**
- * Array: List of paths to JavaScript files to always include
+ * @var array List of paths to JavaScript files to always include
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
*/
protected $scripts = array();
/**
*/
protected $scripts = array();
/**
- * Array: List of JavaScript files to include when using a specific language
+ * @var array List of JavaScript files to include when using a specific language
* @par Usage:
* @code
* array( [language-code] => array( [file-path], [file-path], ... ), ... )
* @par Usage:
* @code
* array( [language-code] => array( [file-path], [file-path], ... ), ... )
*/
protected $languageScripts = array();
/**
*/
protected $languageScripts = array();
/**
- * Array: List of JavaScript files to include when using a specific skin
+ * @var array List of JavaScript files to include when using a specific skin
* @par Usage:
* @code
* array( [skin-name] => array( [file-path], [file-path], ... ), ... )
* @par Usage:
* @code
* array( [skin-name] => array( [file-path], [file-path], ... ), ... )
*/
protected $skinScripts = array();
/**
*/
protected $skinScripts = array();
/**
- * Array: List of paths to JavaScript files to include in debug mode
+ * @var array List of paths to JavaScript files to include in debug mode
* @par Usage:
* @code
* array( [skin-name] => array( [file-path], [file-path], ... ), ... )
* @par Usage:
* @code
* array( [skin-name] => array( [file-path], [file-path], ... ), ... )
*/
protected $debugScripts = array();
/**
*/
protected $debugScripts = array();
/**
- * Array: List of paths to JavaScript files to include in the startup module
+ * @var array List of paths to JavaScript files to include in the startup module
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
*/
protected $loaderScripts = array();
/**
*/
protected $loaderScripts = array();
/**
- * Array: List of paths to CSS files to always include
+ * @var array List of paths to CSS files to always include
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
*/
protected $styles = array();
/**
*/
protected $styles = array();
/**
- * Array: List of paths to CSS files to include when using specific skins
+ * @var array List of paths to CSS files to include when using specific skins
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
*/
protected $skinStyles = array();
/**
*/
protected $skinStyles = array();
/**
- * Array: List of modules this module depends on
+ * @var array List of modules this module depends on
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
*/
protected $dependencies = array();
/**
*/
protected $dependencies = array();
/**
- * Array: List of message keys used by this module
+ * @var array List of message keys used by this module
* @par Usage:
* @code
* array( [message-key], [message-key], ... )
* @endcode
*/
protected $messages = array();
* @par Usage:
* @code
* array( [message-key], [message-key], ... )
* @endcode
*/
protected $messages = array();
- /** String: Name of group to load this module in */
+ /** @var string Name of group to load this module in */
- /** String: Position on the page to load this module at */
+ /** @var string Position on the page to load this module at */
protected $position = 'bottom';
protected $position = 'bottom';
- /** Boolean: Link to raw files in debug mode */
+ /** @var bool Link to raw files in debug mode */
protected $debugRaw = true;
protected $debugRaw = true;
- /** Boolean: Whether mw.loader.state() call should be omitted */
+ /** @var bool Whether mw.loader.state() call should be omitted */
protected $raw = false;
protected $targets = array( 'desktop' );
/**
protected $raw = false;
protected $targets = array( 'desktop' );
/**
- * Boolean: Whether getStyleURLsForDebug should return raw file paths,
+ * @var bool Whether getStyleURLsForDebug should return raw file paths,
* or return load.php urls
*/
protected $hasGeneratedStyles = false;
/**
* or return load.php urls
*/
protected $hasGeneratedStyles = false;
/**
- * Array: Cache for mtime
+ * @var array Cache for mtime
* @par Usage:
* @code
* array( [hash] => [mtime], [hash] => [mtime], ... )
* @par Usage:
* @code
* array( [hash] => [mtime], [hash] => [mtime], ... )
*/
protected $modifiedTime = array();
/**
*/
protected $modifiedTime = array();
/**
- * Array: Place where readStyleFile() tracks file dependencies
+ * @var array Place where readStyleFile() tracks file dependencies
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* @par Usage:
* @code
* array( [file-path], [file-path], ... )
* Gets all scripts for a given context concatenated together.
*
* @param ResourceLoaderContext $context Context in which to generate script
* Gets all scripts for a given context concatenated together.
*
* @param ResourceLoaderContext $context Context in which to generate script
- * @return string: JavaScript code for $context
+ * @return string JavaScript code for $context
*/
public function getScript( ResourceLoaderContext $context ) {
$files = $this->getScriptFiles( $context );
*/
public function getScript( ResourceLoaderContext $context ) {
$files = $this->getScriptFiles( $context );
/**
* Gets loader script.
*
/**
* Gets loader script.
*
- * @return string: JavaScript code to be added to startup module
+ * @return string JavaScript code to be added to startup module
*/
public function getLoaderScript() {
if ( count( $this->loaderScripts ) == 0 ) {
*/
public function getLoaderScript() {
if ( count( $this->loaderScripts ) == 0 ) {
* Gets all styles for a given context concatenated together.
*
* @param ResourceLoaderContext $context Context in which to generate styles
* Gets all styles for a given context concatenated together.
*
* @param ResourceLoaderContext $context Context in which to generate styles
- * @return string: CSS code for $context
+ * @return string CSS code for $context
*/
public function getStyles( ResourceLoaderContext $context ) {
$styles = $this->readStyleFiles(
*/
public function getStyles( ResourceLoaderContext $context ) {
$styles = $this->readStyleFiles(
/**
* Gets list of message keys used by this module.
*
/**
* Gets list of message keys used by this module.
*
- * @return array: List of message keys
+ * @return array List of message keys
*/
public function getMessages() {
return $this->messages;
*/
public function getMessages() {
return $this->messages;
/**
* Gets the name of the group this module should be loaded in.
*
/**
* Gets the name of the group this module should be loaded in.
*
- * @return string: Group name
+ * @return string Group name
*/
public function getGroup() {
return $this->group;
*/
public function getGroup() {
return $this->group;
/**
* Gets list of names of modules this module depends on.
*
/**
* Gets list of names of modules this module depends on.
*
- * @return array: List of module names
+ * @return array List of module names
*/
public function getDependencies() {
return $this->dependencies;
*/
public function getDependencies() {
return $this->dependencies;
*
* @param ResourceLoaderContext $context Context in which to calculate
* the modified time
*
* @param ResourceLoaderContext $context Context in which to calculate
* the modified time
- * @return int: UNIX timestamp
+ * @return int UNIX timestamp
* @see ResourceLoaderModule::getFileDependencies
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
* @see ResourceLoaderModule::getFileDependencies
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
/**
* Get the definition summary for this module.
*
/**
* Get the definition summary for this module.
*
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
$summary = array(
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
$summary = array(
*
* @since 1.22
* @param string $path
*
* @since 1.22
* @param string $path
- * @return string: the stylesheet language name
+ * @return string The stylesheet language name
*/
public function getStyleSheetLang( $path ) {
return preg_match( '/\.less$/i', $path ) ? 'less' : 'css';
*/
public function getStyleSheetLang( $path ) {
return preg_match( '/\.less$/i', $path ) ? 'less' : 'css';
*
* @param array $list List of file paths in any combination of index/path
* or path/options pairs
*
* @param array $list List of file paths in any combination of index/path
* or path/options pairs
- * @param string $option option name
- * @param mixed $default default value if the option isn't set
- * @return array: List of file paths, collated by $option
+ * @param string $option Option name
+ * @param mixed $default Default value if the option isn't set
+ * @return array List of file paths, collated by $option
*/
protected static function collateFilePathListByOption( array $list, $option, $default ) {
$collatedFiles = array();
*/
protected static function collateFilePathListByOption( array $list, $option, $default ) {
$collatedFiles = array();
* @param array $list List of lists to select from
* @param string $key Key to look for in $map
* @param string $fallback Key to look for in $list if $key doesn't exist
* @param array $list List of lists to select from
* @param string $key Key to look for in $map
* @param string $fallback Key to look for in $list if $key doesn't exist
- * @return array: List of elements from $map which matched $key or $fallback,
+ * @return array List of elements from $map which matched $key or $fallback,
* or an empty list in case of no match
*/
protected static function tryForKey( array $list, $key, $fallback = null ) {
* or an empty list in case of no match
*/
protected static function tryForKey( array $list, $key, $fallback = null ) {
* Gets a list of file paths for all scripts in this module, in order of propper execution.
*
* @param ResourceLoaderContext $context
* Gets a list of file paths for all scripts in this module, in order of propper execution.
*
* @param ResourceLoaderContext $context
- * @return array: List of file paths
+ * @return array List of file paths
*/
protected function getScriptFiles( ResourceLoaderContext $context ) {
$files = array_merge(
*/
protected function getScriptFiles( ResourceLoaderContext $context ) {
$files = array_merge(
* Gets a list of file paths for all styles in this module, in order of propper inclusion.
*
* @param ResourceLoaderContext $context
* Gets a list of file paths for all styles in this module, in order of propper inclusion.
*
* @param ResourceLoaderContext $context
- * @return array: List of file paths
+ * @return array List of file paths
*/
protected function getStyleFiles( ResourceLoaderContext $context ) {
return array_merge_recursive(
*/
protected function getStyleFiles( ResourceLoaderContext $context ) {
return array_merge_recursive(
*
* @param array $scripts List of file paths to scripts to read, remap and concetenate
* @throws MWException
*
* @param array $scripts List of file paths to scripts to read, remap and concetenate
* @throws MWException
- * @return string: Concatenated and remapped JavaScript data from $scripts
+ * @return string Concatenated and remapped JavaScript data from $scripts
*/
protected function readScriptFiles( array $scripts ) {
global $wgResourceLoaderValidateStaticJS;
*/
protected function readScriptFiles( array $scripts ) {
global $wgResourceLoaderValidateStaticJS;
* @param bool $flip
*
* @throws MWException
* @param bool $flip
*
* @throws MWException
- * @return array: List of concatenated and remapped CSS data from $styles,
+ * @return array List of concatenated and remapped CSS data from $styles,
* keyed by media type
*/
protected function readStyleFiles( array $styles, $flip ) {
* keyed by media type
*/
protected function readStyleFiles( array $styles, $flip ) {
* @param string $path File path of style file to read
* @param bool $flip
*
* @param string $path File path of style file to read
* @param bool $flip
*
- * @return string: CSS data in script file
+ * @return string CSS data in script file
* @throws MWException if the file doesn't exist
*/
protected function readStyleFile( $path, $flip ) {
* @throws MWException if the file doesn't exist
*/
protected function readStyleFile( $path, $flip ) {
/**
* Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
*
/**
* Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
*
- * @return array of strings
+ * @return array Array of strings
*/
public function getTargets() {
return $this->targets;
*/
public function getTargets() {
return $this->targets;
*
* @since 1.22
* @param string $fileName File name of root LESS file.
*
* @since 1.22
* @param string $fileName File name of root LESS file.
- * @return string: Cache key
+ * @return string Cache key
*/
protected static function getLESSCacheKey( $fileName ) {
$vars = json_encode( ResourceLoader::getLESSVars() );
*/
protected static function getLESSCacheKey( $fileName ) {
$vars = json_encode( ResourceLoader::getLESSVars() );
* @throws Exception If Less encounters a parse error
* @throws MWException If Less compilation returns unexpection result
* @param string $fileName File path of LESS source
* @throws Exception If Less encounters a parse error
* @throws MWException If Less compilation returns unexpection result
* @param string $fileName File path of LESS source
- * @return string: CSS source
+ * @return string CSS source
*/
protected function compileLESSFile( $fileName ) {
$key = self::getLESSCacheKey( $fileName );
*/
protected function compileLESSFile( $fileName ) {
$key = self::getLESSCacheKey( $fileName );
class ResourceLoaderFilePageModule extends ResourceLoaderWikiModule {
/**
class ResourceLoaderFilePageModule extends ResourceLoaderWikiModule {
/**
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
protected function getPages( ResourceLoaderContext $context ) {
* @return array
*/
protected function getPages( ResourceLoaderContext $context ) {
- * @param $context ResourceLoaderContext
- * @return string: JavaScript code
+ * @param ResourceLoaderContext $context
+ * @return string JavaScript code
*/
public function getScript( ResourceLoaderContext $context ) {
$this->language = Language::factory( $context->getLanguage() );
*/
public function getScript( ResourceLoaderContext $context ) {
$this->language = Language::factory( $context->getLanguage() );
- * @param $context ResourceLoaderContext
- * @return int: UNIX timestamp
+ * @param ResourceLoaderContext $context
+ * @return int UNIX timestamp
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
return max( 1, $this->getHashMtime( $context ) );
}
/**
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
return max( 1, $this->getHashMtime( $context ) );
}
/**
- * @param $context ResourceLoaderContext
- * @return string: Hash
+ * @param ResourceLoaderContext $context
+ * @return string Hash
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
$this->language = Language::factory( $context->getLanguage() );
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
$this->language = Language::factory( $context->getLanguage() );
* Get this module's name. This is set when the module is registered
* with ResourceLoader::register()
*
* Get this module's name. This is set when the module is registered
* with ResourceLoader::register()
*
- * @return mixed: Name (string) or null if no name was set
+ * @return string|null Name (string) or null if no name was set
*/
public function getName() {
return $this->name;
*/
public function getName() {
return $this->name;
* Get this module's origin. This is set when the module is registered
* with ResourceLoader::register()
*
* Get this module's origin. This is set when the module is registered
* with ResourceLoader::register()
*
- * @return int: ResourceLoaderModule class constant, the subclass default
+ * @return int ResourceLoaderModule class constant, the subclass default
* if not set manually
*/
public function getOrigin() {
* if not set manually
*/
public function getOrigin() {
* Set this module's origin. This is called by ResourceLoader::register()
* when registering the module. Other code should not call this.
*
* Set this module's origin. This is called by ResourceLoader::register()
* when registering the module. Other code should not call this.
*
- * @param int $origin origin
+ * @param int $origin Origin
*/
public function setOrigin( $origin ) {
$this->origin = $origin;
*/
public function setOrigin( $origin ) {
$this->origin = $origin;
* Includes all relevant JS except loader scripts.
*
* @param ResourceLoaderContext $context
* Includes all relevant JS except loader scripts.
*
* @param ResourceLoaderContext $context
- * @return string: JavaScript code
+ * @return string JavaScript code
*/
public function getScript( ResourceLoaderContext $context ) {
// Stub, override expected
*/
public function getScript( ResourceLoaderContext $context ) {
// Stub, override expected
* MUST return either an only= URL or a non-load.php URL.
*
* @param ResourceLoaderContext $context
* MUST return either an only= URL or a non-load.php URL.
*
* @param ResourceLoaderContext $context
- * @return array: Array of URLs
+ * @return array Array of URLs
*/
public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
$url = ResourceLoader::makeLoaderURL(
*/
public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
$url = ResourceLoader::makeLoaderURL(
* Get all CSS for this module for a given skin.
*
* @param ResourceLoaderContext $context
* Get all CSS for this module for a given skin.
*
* @param ResourceLoaderContext $context
- * @return array: List of CSS strings or array of CSS strings keyed by media type.
+ * @return array List of CSS strings or array of CSS strings keyed by media type.
* like array( 'screen' => '.foo { width: 0 }' );
* or array( 'screen' => array( '.foo { width: 0 }' ) );
*/
* like array( 'screen' => '.foo { width: 0 }' );
* or array( 'screen' => array( '.foo { width: 0 }' ) );
*/
* load the files directly. See also getScriptURLsForDebug()
*
* @param ResourceLoaderContext $context
* load the files directly. See also getScriptURLsForDebug()
*
* @param ResourceLoaderContext $context
- * @return array: array( mediaType => array( URL1, URL2, ... ), ... )
+ * @return array array( mediaType => array( URL1, URL2, ... ), ... )
*/
public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
$url = ResourceLoader::makeLoaderURL(
*/
public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
$url = ResourceLoader::makeLoaderURL(
*
* To get a JSON blob with messages, use MessageBlobStore::get()
*
*
* To get a JSON blob with messages, use MessageBlobStore::get()
*
- * @return array: List of message keys. Keys may occur more than once
+ * @return array List of message keys. Keys may occur more than once
*/
public function getMessages() {
// Stub, override expected
*/
public function getMessages() {
// Stub, override expected
/**
* Get the group this module is in.
*
/**
* Get the group this module is in.
*
- * @return string: Group name
+ * @return string Group name
*/
public function getGroup() {
// Stub, override expected
*/
public function getGroup() {
// Stub, override expected
/**
* Get the origin of this module. Should only be overridden for foreign modules.
*
/**
* Get the origin of this module. Should only be overridden for foreign modules.
*
- * @return string: Origin name, 'local' for local modules
+ * @return string Origin name, 'local' for local modules
*/
public function getSource() {
// Stub, override expected
*/
public function getSource() {
// Stub, override expected
/**
* Get the loader JS for this module, if set.
*
/**
* Get the loader JS for this module, if set.
*
- * @return mixed: JavaScript loader code as a string or boolean false if no custom loader set
+ * @return mixed JavaScript loader code as a string or boolean false if no custom loader set
*/
public function getLoaderScript() {
// Stub, override expected
*/
public function getLoaderScript() {
// Stub, override expected
*
* To add dependencies dynamically on the client side, use a custom
* loader script, see getLoaderScript()
*
* To add dependencies dynamically on the client side, use a custom
* loader script, see getLoaderScript()
- * @return array: List of module names as strings
+ * @return array List of module names as strings
*/
public function getDependencies() {
// Stub, override expected
*/
public function getDependencies() {
// Stub, override expected
/**
* Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
*
/**
* Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']
*
- * @return array: Array of strings
+ * @return array Array of strings
*/
public function getTargets() {
return $this->targets;
*/
public function getTargets() {
return $this->targets;
* Currently these are only image files referenced by the module's CSS.
*
* @param string $skin Skin name
* Currently these are only image files referenced by the module's CSS.
*
* @param string $skin Skin name
- * @return array: List of files
+ * @return array List of files
*/
public function getFileDependencies( $skin ) {
// Try in-object cache first
*/
public function getFileDependencies( $skin ) {
// Try in-object cache first
* Get the last modification timestamp of the message blob for this
* module in a given language.
* @param string $lang Language code
* Get the last modification timestamp of the message blob for this
* module in a given language.
* @param string $lang Language code
- * @return int: UNIX timestamp, or 0 if the module doesn't have messages
+ * @return int UNIX timestamp, or 0 if the module doesn't have messages
*/
public function getMsgBlobMtime( $lang ) {
if ( !isset( $this->msgBlobMtime[$lang] ) ) {
*/
public function getMsgBlobMtime( $lang ) {
if ( !isset( $this->msgBlobMtime[$lang] ) ) {
* Set a preloaded message blob last modification timestamp. Used so we
* can load this information for all modules at once.
* @param string $lang Language code
* Set a preloaded message blob last modification timestamp. Used so we
* can load this information for all modules at once.
* @param string $lang Language code
- * @param $mtime Integer: UNIX timestamp or 0 if there is no such blob
+ * @param int $mtime UNIX timestamp or 0 if there is no such blob
*/
public function setMsgBlobMtime( $lang, $mtime ) {
$this->msgBlobMtime[$lang] = $mtime;
*/
public function setMsgBlobMtime( $lang, $mtime ) {
$this->msgBlobMtime[$lang] = $mtime;
* yourself and take its result into consideration.
*
* @param ResourceLoaderContext $context Context object
* yourself and take its result into consideration.
*
* @param ResourceLoaderContext $context Context object
- * @return integer UNIX timestamp
+ * @return int UNIX timestamp
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
// 0 would mean now
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
// 0 would mean now
* Helper method for calculating when the module's hash (if it has one) changed.
*
* @param ResourceLoaderContext $context
* Helper method for calculating when the module's hash (if it has one) changed.
*
* @param ResourceLoaderContext $context
- * @return integer: UNIX timestamp or 0 if no hash was provided
+ * @return int UNIX timestamp or 0 if no hash was provided
* by getModifiedHash()
*/
public function getHashMtime( ResourceLoaderContext $context ) {
* by getModifiedHash()
*/
public function getHashMtime( ResourceLoaderContext $context ) {
* use of getHashMTime() inside getModifiedTime().
*
* @param ResourceLoaderContext $context
* use of getHashMTime() inside getModifiedTime().
*
* @param ResourceLoaderContext $context
- * @return string|null: Hash
+ * @return string|null Hash
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
return null;
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
return null;
/**
* Helper method for calculating when this module's definition summary was last changed.
*
/**
* Helper method for calculating when this module's definition summary was last changed.
*
- * @return integer: UNIX timestamp or 0 if no definition summary was provided
+ * @return int UNIX timestamp or 0 if no definition summary was provided
* by getDefinitionSummary()
*/
public function getDefinitionMtime( ResourceLoaderContext $context ) {
* by getDefinitionSummary()
*/
public function getDefinitionMtime( ResourceLoaderContext $context ) {
* contain arrays and scalars as values (avoid object instances) which means
* it requires abstraction.
*
* contain arrays and scalars as values (avoid object instances) which means
* it requires abstraction.
*
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
return array(
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
return array(
*
* @param string $fileName
* @param string $contents
*
* @param string $fileName
* @param string $contents
- * @return string: JS with the original, or a replacement error
+ * @return string JS with the original, or a replacement error
*/
protected function validateScriptFile( $fileName, $contents ) {
global $wgResourceLoaderValidateJS;
*/
protected function validateScriptFile( $fileName, $contents ) {
global $wgResourceLoaderValidateJS;
* Gets list of pages used by this module. Obviously, it makes absolutely no
* sense to include JavaScript files here... :D
*
* Gets list of pages used by this module. Obviously, it makes absolutely no
* sense to include JavaScript files here... :D
*
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
- * @return Array: List of pages
+ * @return array List of pages
*/
protected function getPages( ResourceLoaderContext $context ) {
return array( 'MediaWiki:Noscript.css' => array( 'type' => 'style' ) );
*/
protected function getPages( ResourceLoaderContext $context ) {
return array( 'MediaWiki:Noscript.css' => array( 'type' => 'style' ) );
- * @return String: Name of group
+ * @return string Name of group
*/
public function getGroup() {
return 'noscript';
*/
public function getGroup() {
return 'noscript';
/**
* Gets list of pages used by this module
*
/**
* Gets list of pages used by this module
*
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
- * @return Array: List of pages
+ * @return array List of pages
*/
protected function getPages( ResourceLoaderContext $context ) {
global $wgUseSiteJs, $wgUseSiteCss;
*/
protected function getPages( ResourceLoaderContext $context ) {
global $wgUseSiteJs, $wgUseSiteCss;
- * @return String: Name of group
+ * @return string Name of group
*/
public function getGroup() {
return 'site';
*/
public function getGroup() {
return 'site';
/**
* Get registration code for all modules.
*
/**
* Get registration code for all modules.
*
- * @param ResourceLoaderContext $context object
+ * @param ResourceLoaderContext $context
* @return string JavaScript code for registering all modules with the client loader
*/
public static function getModuleRegistrations( ResourceLoaderContext $context ) {
* @return string JavaScript code for registering all modules with the client loader
*/
public static function getModuleRegistrations( ResourceLoaderContext $context ) {
*
* Detect changes to mw.config settings embedded in #getScript (bug 28899).
*
*
* Detect changes to mw.config settings embedded in #getScript (bug 28899).
*
- * @param $context ResourceLoaderContext
- * @return string: Hash
+ * @param ResourceLoaderContext $context
+ * @return string Hash
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
global $wgLegacyJavaScriptGlobals;
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
global $wgLegacyJavaScriptGlobals;
- * @param $context ResourceLoaderContext
- * @return array|int|Mixed
+ * @param ResourceLoaderContext $context
+ * @return array|int|mixed
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
$hash = $context->getHash();
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
$hash = $context->getHash();
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
public function getStyles( ResourceLoaderContext $context ) {
* @return array
*/
public function getStyles( ResourceLoaderContext $context ) {
/* Protected Methods */
/**
/* Protected Methods */
/**
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
protected function getPages( ResourceLoaderContext $context ) {
* @return array
*/
protected function getPages( ResourceLoaderContext $context ) {
/* Protected Methods */
/**
/* Protected Methods */
/**
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
protected function getPages( ResourceLoaderContext $context ) {
* @return array
*/
protected function getPages( ResourceLoaderContext $context ) {
- * @param $context ResourceLoaderContext
- * @return array|int|Mixed
+ * @param ResourceLoaderContext $context
+ * @return array|int|mixed
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
$hash = $context->getHash();
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
$hash = $context->getHash();
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
/**
* Fetch the tokens for the current user.
*
/**
* Fetch the tokens for the current user.
*
- * @return array: List of tokens keyed by token type
+ * @return array List of tokens keyed by token type
*/
protected function contextUserTokens() {
global $wgUser;
*/
protected function contextUserTokens() {
global $wgUser;
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
* There is an optional media key, the value of which can be the
* medium ('screen', 'print', etc.) of the stylesheet.
*
* There is an optional media key, the value of which can be the
* medium ('screen', 'print', etc.) of the stylesheet.
*
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
abstract protected function getPages( ResourceLoaderContext $context );
* @return array
*/
abstract protected function getPages( ResourceLoaderContext $context );
* @return null|string
*/
protected function getContent( $title ) {
* @return null|string
*/
protected function getContent( $title ) {
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
* @return string
*/
public function getScript( ResourceLoaderContext $context ) {
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return array
*/
public function getStyles( ResourceLoaderContext $context ) {
* @return array
*/
public function getStyles( ResourceLoaderContext $context ) {
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return int|mixed
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
* @return int|mixed
*/
public function getModifiedTime( ResourceLoaderContext $context ) {
/**
* Get the definition summary for this module.
*
/**
* Get the definition summary for this module.
*
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
return array(
*/
public function getDefinitionSummary( ResourceLoaderContext $context ) {
return array(
- * @param $context ResourceLoaderContext
+ * @param ResourceLoaderContext $context
* @return bool
*/
public function isKnownEmpty( ResourceLoaderContext $context ) {
* @return bool
*/
public function isKnownEmpty( ResourceLoaderContext $context ) {
/**
* Get the modification times of all titles that would be loaded for
* a given context.
/**
* Get the modification times of all titles that would be loaded for
* a given context.
- * @param $context ResourceLoaderContext: Context object
+ * @param ResourceLoaderContext $context Context object
* @return array( prefixed DB key => UNIX timestamp ), nonexistent titles are dropped
*/
protected function getTitleMtimes( ResourceLoaderContext $context ) {
* @return array( prefixed DB key => UNIX timestamp ), nonexistent titles are dropped
*/
protected function getTitleMtimes( ResourceLoaderContext $context ) {
var $namespaces = array( NS_MAIN );
protected $showSuggestion = true;
var $namespaces = array( NS_MAIN );
protected $showSuggestion = true;
- /** @var Array Feature values */
+ /** @var array Feature values */
protected $features = array();
/**
protected $features = array();
/**
* If title searches are not supported or disabled, return null.
* STUB
*
* If title searches are not supported or disabled, return null.
* STUB
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return SearchResultSet|Status|null
*/
function searchText( $term ) {
* @return SearchResultSet|Status|null
*/
function searchText( $term ) {
* If title searches are not supported or disabled, return null.
* STUB
*
* If title searches are not supported or disabled, return null.
* STUB
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return SearchResultSet|null
*/
function searchTitle( $term ) {
* @return SearchResultSet|null
*/
function searchTitle( $term ) {
- * @param $feature String
- * @return Boolean
+ * @param string $feature
+ * @return bool
*/
public function supports( $feature ) {
switch ( $feature ) {
*/
public function supports( $feature ) {
switch ( $feature ) {
/**
* Way to pass custom data for engines
* @since 1.18
/**
* Way to pass custom data for engines
* @since 1.18
- * @param $feature String
- * @param $data Mixed
+ * @param string $feature
+ * @param mixed $data
* @return bool
*/
public function setFeatureData( $feature, $data ) {
* @return bool
*/
public function setFeatureData( $feature, $data ) {
* If an exact title match can be found, or a very slightly close match,
* return the title. If no match, returns NULL.
*
* If an exact title match can be found, or a very slightly close match,
* return the title. If no match, returns NULL.
*
- * @param $searchterm String
+ * @param string $searchterm
* @return Title
*/
public static function getNearMatch( $searchterm ) {
* @return Title
*/
public static function getNearMatch( $searchterm ) {
* Do a near match (see SearchEngine::getNearMatch) and wrap it into a
* SearchResultSet.
*
* Do a near match (see SearchEngine::getNearMatch) and wrap it into a
* SearchResultSet.
*
- * @param $searchterm string
+ * @param string $searchterm
* @return SearchResultSet
*/
public static function getNearMatchResultSet( $searchterm ) {
* @return SearchResultSet
*/
public static function getNearMatchResultSet( $searchterm ) {
* Set the maximum number of results to return
* and how many to skip before returning the first.
*
* Set the maximum number of results to return
* and how many to skip before returning the first.
*
- * @param $limit Integer
- * @param $offset Integer
+ * @param int $limit
+ * @param int $offset
*/
function setLimitOffset( $limit, $offset = 0 ) {
$this->limit = intval( $limit );
*/
function setLimitOffset( $limit, $offset = 0 ) {
$this->limit = intval( $limit );
* Set which namespaces the search should include.
* Give an array of namespace index numbers.
*
* Set which namespaces the search should include.
* Give an array of namespace index numbers.
*
- * @param $namespaces Array
+ * @param array $namespaces
*/
function setNamespaces( $namespaces ) {
$this->namespaces = $namespaces;
*/
function setNamespaces( $namespaces ) {
$this->namespaces = $namespaces;
* don't support building a suggestion in the first place and others don't respect
* this flag.
*
* don't support building a suggestion in the first place and others don't respect
* this flag.
*
- * @param boolean $showSuggestion should the searcher try to build suggestions
+ * @param bool $showSuggestion Should the searcher try to build suggestions
*/
function setShowSuggestion( $showSuggestion ) {
$this->showSuggestion = $showSuggestion;
*/
function setShowSuggestion( $showSuggestion ) {
$this->showSuggestion = $showSuggestion;
* Parse some common prefixes: all (search everything)
* or namespace names
*
* Parse some common prefixes: all (search everything)
* or namespace names
*
* @return string
*/
function replacePrefixes( $query ) {
* @return string
*/
function replacePrefixes( $query ) {
/**
* Make a list of searchable namespaces and their canonical names.
/**
* Make a list of searchable namespaces and their canonical names.
*/
public static function searchableNamespaces() {
global $wgContLang;
*/
public static function searchableNamespaces() {
global $wgContLang;
* Extract default namespaces to search from the given user's
* settings, returning a list of index numbers.
*
* Extract default namespaces to search from the given user's
* settings, returning a list of index numbers.
*
- * @param $user User
- * @return Array
+ * @param user $user
+ * @return array
*/
public static function userNamespaces( $user ) {
global $wgSearchEverythingOnlyLoggedIn;
*/
public static function userNamespaces( $user ) {
global $wgSearchEverythingOnlyLoggedIn;
/**
* Find snippet highlight settings for all users
*
/**
* Find snippet highlight settings for all users
*
- * @return Array contextlines, contextchars
+ * @return array Contextlines, contextchars
*/
public static function userHighlightPrefs() {
$contextlines = 2; // Hardcode this. Old defaults sucked. :)
*/
public static function userHighlightPrefs() {
$contextlines = 2; // Hardcode this. Old defaults sucked. :)
/**
* An array of namespaces indexes to be searched by default
*
/**
* An array of namespaces indexes to be searched by default
*
*/
public static function defaultNamespaces() {
global $wgNamespacesToBeSearchedDefault;
*/
public static function defaultNamespaces() {
global $wgNamespacesToBeSearchedDefault;
* Get a list of namespace names useful for showing in tooltips
* and preferences
*
* Get a list of namespace names useful for showing in tooltips
* and preferences
*
- * @param $namespaces Array
+ * @param array $namespaces
* @return array
*/
public static function namespacesAsText( $namespaces ) {
* @return array
*/
public static function namespacesAsText( $namespaces ) {
/**
* Return the help namespaces to be shown on Special:Search
*
/**
* Return the help namespaces to be shown on Special:Search
*
*/
public static function helpNamespaces() {
global $wgNamespacesToBeSearchedHelp;
*/
public static function helpNamespaces() {
global $wgNamespacesToBeSearchedHelp;
/**
* Return a 'cleaned up' search string
*
/**
* Return a 'cleaned up' search string
*
- * @param $text String
- * @return String
+ * @param string $text
+ * @return string
*/
function filter( $text ) {
$lc = $this->legalSearchChars();
*/
function filter( $text ) {
$lc = $this->legalSearchChars();
* Load up the appropriate search engine class for the currently
* active database backend, and return a configured instance.
*
* Load up the appropriate search engine class for the currently
* active database backend, and return a configured instance.
*
- * @param String $type Type of search backend, if not the default
+ * @param string $type Type of search backend, if not the default
* @return SearchEngine
*/
public static function create( $type = null ) {
* @return SearchEngine
*/
public static function create( $type = null ) {
* Title and text should be pre-processed.
* STUB
*
* Title and text should be pre-processed.
* STUB
*
- * @param $id Integer
- * @param $title String
- * @param $text String
+ * @param int $id
+ * @param string $title
+ * @param string $text
*/
function update( $id, $title, $text ) {
// no-op
*/
function update( $id, $title, $text ) {
// no-op
* Title should be pre-processed.
* STUB
*
* Title should be pre-processed.
* STUB
*
- * @param $id Integer
- * @param $title String
+ * @param int $id
+ * @param string $title
*/
function updateTitle( $id, $title ) {
// no-op
*/
function updateTitle( $id, $title ) {
// no-op
* Title should be pre-processed.
* STUB
*
* Title should be pre-processed.
* STUB
*
- * @param Integer $id Page id that was deleted
- * @param String $title Title of page that was deleted
+ * @param int $id Page id that was deleted
+ * @param string $title Title of page that was deleted
*/
function delete( $id, $title ) {
// no-op
*/
function delete( $id, $title ) {
// no-op
/**
* Get OpenSearch suggestion template
*
/**
* Get OpenSearch suggestion template
*
*/
public static function getOpenSearchTemplate() {
global $wgOpenSearchTemplate, $wgCanonicalServer;
*/
public static function getOpenSearchTemplate() {
global $wgOpenSearchTemplate, $wgCanonicalServer;
/**
* Default implementation of wikitext highlighting
*
/**
* Default implementation of wikitext highlighting
*
- * @param $text String
- * @param array $terms terms to highlight (unescaped)
- * @param $contextlines Integer
- * @param $contextchars Integer
- * @return String
+ * @param string $text
+ * @param array $terms Terms to highlight (unescaped)
+ * @param int $contextlines
+ * @param int $contextchars
+ * @return tring
*/
public function highlightText( $text, $terms, $contextlines, $contextchars ) {
global $wgContLang;
*/
public function highlightText( $text, $terms, $contextlines, $contextchars ) {
global $wgContLang;
* Split text into lines and add it to extracts array
*
* @param array $extracts index -> $line
* Split text into lines and add it to extracts array
*
* @param array $extracts index -> $line
- * @param $count Integer
- * @param $text String
+ * @param int $count
+ * @param string $text
*/
function splitAndAdd( &$extracts, &$count, $text ) {
$split = explode( "\n", $this->mCleanWikitext ? $this->removeWiki( $text ) : $text );
*/
function splitAndAdd( &$extracts, &$count, $text ) {
$split = explode( "\n", $this->mCleanWikitext ? $this->removeWiki( $text ) : $text );
/**
* Do manual case conversion for non-ascii chars
*
/**
* Do manual case conversion for non-ascii chars
*
- * @param $matches Array
+ * @param array $matches
* @return string
*/
function caseCallback( $matches ) {
* @return string
*/
function caseCallback( $matches ) {
/**
* Extract part of the text from start to end, but by
* not chopping up words
/**
* Extract part of the text from start to end, but by
* not chopping up words
- * @param $text String
- * @param $start Integer
- * @param $end Integer
- * @param $posStart Integer: (out) actual start position
- * @param $posEnd Integer: (out) actual end position
- * @return String
+ * @param string $text
+ * @param int $start
+ * @param int $end
+ * @param int $posStart (out) actual start position
+ * @param int $posEnd (out) actual end position
+ * @return string
*/
function extract( $text, $start, $end, &$posStart = null, &$posEnd = null ) {
if ( $start != 0 ) {
*/
function extract( $text, $start, $end, &$posStart = null, &$posEnd = null ) {
if ( $start != 0 ) {
/**
* Find a nonletter near a point (index) in the text
*
/**
* Find a nonletter near a point (index) in the text
*
- * @param $text String
- * @param $point Integer
- * @param $offset Integer: offset to found index
- * @return Integer: nearest nonletter index, or beginning of utf8 char if none
+ * @param string $text
+ * @param int $point
+ * @param int $offset Offset to found index
+ * @return int Nearest nonletter index, or beginning of utf8 char if none
*/
function position( $text, $point, $offset = 0 ) {
$tolerance = 10;
*/
function position( $text, $point, $offset = 0 ) {
$tolerance = 10;
/**
* Search extracts for a pattern, and return snippets
*
/**
* Search extracts for a pattern, and return snippets
*
- * @param string $pattern regexp for matching lines
- * @param array $extracts extracts to search
- * @param $linesleft Integer: number of extracts to make
- * @param $contextchars Integer: length of snippet
- * @param array $out map for highlighted snippets
- * @param array $offsets map of starting points of snippets
+ * @param string $pattern Regexp for matching lines
+ * @param array $extracts Extracts to search
+ * @param int $linesleft Number of extracts to make
+ * @param int $contextchars Length of snippet
+ * @param array $out Map for highlighted snippets
+ * @param array $offsets Map of starting points of snippets
* @protected
*/
function process( $pattern, $extracts, &$linesleft, &$contextchars, &$out, &$offsets ) {
* @protected
*/
function process( $pattern, $extracts, &$linesleft, &$contextchars, &$out, &$offsets ) {
* callback to replace [[target|caption]] kind of links, if
* the target is category or image, leave it
*
* callback to replace [[target|caption]] kind of links, if
* the target is category or image, leave it
*
- * @param $matches Array
+ * @param array $matches
*/
function linkReplace( $matches ) {
$colon = strpos( $matches[1], ':' );
*/
function linkReplace( $matches ) {
$colon = strpos( $matches[1], ':' );
* Simple & fast snippet extraction, but gives completely unrelevant
* snippets
*
* Simple & fast snippet extraction, but gives completely unrelevant
* snippets
*
- * @param $text String
- * @param $terms Array
- * @param $contextlines Integer
- * @param $contextchars Integer
- * @return String
+ * @param string $text
+ * @param array $terms
+ * @param int $contextlines
+ * @param int $contextchars
+ * @return string
*/
public function highlightSimple( $text, $terms, $contextlines, $contextchars ) {
global $wgContLang;
*/
public function highlightSimple( $text, $terms, $contextlines, $contextchars ) {
global $wgContLang;
/**
* Perform a full text search query and return a result set.
*
/**
* Perform a full text search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return MssqlSearchResultSet
* @access public
*/
* @return MssqlSearchResultSet
* @access public
*/
/**
* Perform a title-only search query and return a result set.
*
/**
* Perform a title-only search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return MssqlSearchResultSet
* @access public
*/
* @return MssqlSearchResultSet
* @access public
*/
/**
* Return a partial WHERE clause to limit the search to the given namespaces
*
/**
* Return a partial WHERE clause to limit the search to the given namespaces
*
* @private
*/
function queryNamespaces() {
* @private
*/
function queryNamespaces() {
/**
* Return a LIMIT clause to limit results on the query.
*
/**
* Return a LIMIT clause to limit results on the query.
*
*/
function queryLimit( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
*/
function queryLimit( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
* Does not do anything for generic search engine
* subclasses may define this though
*
* Does not do anything for generic search engine
* subclasses may define this though
*
*/
function queryRanking( $filteredTerm, $fulltext ) {
return ' ORDER BY ftindex.[RANK] DESC'; // return ' ORDER BY score(1)';
*/
function queryRanking( $filteredTerm, $fulltext ) {
return ' ORDER BY ftindex.[RANK] DESC'; // return ' ORDER BY score(1)';
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
*
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
*
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return String
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return string
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
/**
* Picks which field to index on, depending on what type of query.
*
/**
* Picks which field to index on, depending on what type of query.
*
- * @param $fulltext Boolean
+ * @param bool $fulltext
* @return string
*/
function getIndexField( $fulltext ) {
* @return string
*/
function getIndexField( $fulltext ) {
/**
* Get the base part of the search query.
*
/**
* Get the base part of the search query.
*
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return String
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return string
* @private
*/
function queryMain( $filteredTerm, $fulltext ) {
* @private
*/
function queryMain( $filteredTerm, $fulltext ) {
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
- * @param $id Integer
- * @param $title String
- * @param $text String
+ * @param int $id
+ * @param string $title
+ * @param string $text
* @return bool|ResultWrapper
*/
function update( $id, $title, $text ) {
* @return bool|ResultWrapper
*/
function update( $id, $title, $text ) {
* Update a search index record's title only.
* Title should be pre-processed.
*
* Update a search index record's title only.
* Title should be pre-processed.
*
- * @param $id Integer
- * @param $title String
+ * @param int $id
+ * @param string $title
* @return bool|ResultWrapper
*/
function updateTitle( $id, $title ) {
* @return bool|ResultWrapper
*/
function updateTitle( $id, $title ) {
* Parse the user's query and transform it into an SQL fragment which will
* become part of a WHERE clause
*
* Parse the user's query and transform it into an SQL fragment which will
* become part of a WHERE clause
*
- * @param $filteredText string
- * @param $fulltext string
+ * @param string $filteredText
+ * @param string $fulltext
/**
* Perform a full text search query and return a result set.
*
/**
* Perform a full text search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return MySQLSearchResultSet
*/
function searchText( $term ) {
* @return MySQLSearchResultSet
*/
function searchText( $term ) {
/**
* Perform a title-only search query and return a result set.
*
/**
* Perform a title-only search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return MySQLSearchResultSet
*/
function searchTitle( $term ) {
* @return MySQLSearchResultSet
*/
function searchTitle( $term ) {
/**
* Add special conditions
/**
* Add special conditions
* @since 1.18
*/
protected function queryFeatures( &$query ) {
* @since 1.18
*/
protected function queryFeatures( &$query ) {
/**
* Add namespace conditions
/**
* Add namespace conditions
* @since 1.18 (changed)
*/
function queryNamespaces( &$query ) {
* @since 1.18 (changed)
*/
function queryNamespaces( &$query ) {
* @since 1.18
*/
protected function limitResult( &$query ) {
* @since 1.18
*/
protected function limitResult( &$query ) {
/**
* Construct the SQL query to do the search.
* The guts shoulds be constructed in queryMain()
/**
* Construct the SQL query to do the search.
* The guts shoulds be constructed in queryMain()
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return Array
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return array
* @since 1.18 (changed)
*/
function getQuery( $filteredTerm, $fulltext ) {
* @since 1.18 (changed)
*/
function getQuery( $filteredTerm, $fulltext ) {
/**
* Picks which field to index on, depending on what type of query.
/**
* Picks which field to index on, depending on what type of query.
- * @param $fulltext Boolean
- * @return String
+ * @param bool $fulltext
+ * @return string
*/
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
*/
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
/**
* Get the base part of the search query.
*
/**
* Get the base part of the search query.
*
- * @param &$query array Search query array
- * @param $filteredTerm String
- * @param $fulltext Boolean
+ * @param array &$query Search query array
+ * @param string $filteredTerm
+ * @param bool $fulltext
* @since 1.18 (changed)
*/
function queryMain( &$query, $filteredTerm, $fulltext ) {
* @since 1.18 (changed)
*/
function queryMain( &$query, $filteredTerm, $fulltext ) {
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
- * @param $id Integer
- * @param $title String
- * @param $text String
+ * @param int $id
+ * @param string $title
+ * @param string $text
*/
function update( $id, $title, $text ) {
$dbw = wfGetDB( DB_MASTER );
*/
function update( $id, $title, $text ) {
$dbw = wfGetDB( DB_MASTER );
* Update a search index record's title only.
* Title should be pre-processed.
*
* Update a search index record's title only.
* Title should be pre-processed.
*
- * @param $id Integer
- * @param $title String
+ * @param int $id
+ * @param string $title
*/
function updateTitle( $id, $title ) {
$dbw = wfGetDB( DB_MASTER );
*/
function updateTitle( $id, $title ) {
$dbw = wfGetDB( DB_MASTER );
* Delete an indexed page
* Title should be pre-processed.
*
* Delete an indexed page
* Title should be pre-processed.
*
- * @param Integer $id Page id that was deleted
- * @param String $title Title of page that was deleted
+ * @param int $id Page id that was deleted
+ * @param string $title Title of page that was deleted
*/
function delete( $id, $title ) {
$dbw = wfGetDB( DB_MASTER );
*/
function delete( $id, $title ) {
$dbw = wfGetDB( DB_MASTER );
/**
* Perform a full text search query and return a result set.
*
/**
* Perform a full text search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return SqlSearchResultSet
*/
function searchText( $term ) {
* @return SqlSearchResultSet
*/
function searchText( $term ) {
/**
* Perform a title-only search query and return a result set.
*
/**
* Perform a title-only search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return SqlSearchResultSet
*/
function searchTitle( $term ) {
* @return SqlSearchResultSet
*/
function searchTitle( $term ) {
/**
* Return a partial WHERE clause to limit the search to the given namespaces
/**
* Return a partial WHERE clause to limit the search to the given namespaces
*/
function queryNamespaces() {
if ( is_null( $this->namespaces ) ) {
*/
function queryNamespaces() {
if ( is_null( $this->namespaces ) ) {
/**
* Return a LIMIT clause to limit results on the query.
*
/**
* Return a LIMIT clause to limit results on the query.
*
*/
function queryLimit( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
*/
function queryLimit( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
* Does not do anything for generic search engine
* subclasses may define this though
*
* Does not do anything for generic search engine
* subclasses may define this though
*
*/
function queryRanking( $filteredTerm, $fulltext ) {
return ' ORDER BY score(1)';
*/
function queryRanking( $filteredTerm, $fulltext ) {
return ' ORDER BY score(1)';
/**
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
/**
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return String
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return string
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
/**
* Picks which field to index on, depending on what type of query.
/**
* Picks which field to index on, depending on what type of query.
- * @param $fulltext Boolean
- * @return String
+ * @param bool $fulltext
+ * @return string
*/
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
*/
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
/**
* Get the base part of the search query.
*
/**
* Get the base part of the search query.
*
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return String
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return string
*/
function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
*/
function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
- * @param $id Integer
- * @param $title String
- * @param $text String
+ * @param int $id
+ * @param string $title
+ * @param string $text
*/
function update( $id, $title, $text ) {
$dbw = wfGetDB( DB_MASTER );
*/
function update( $id, $title, $text ) {
$dbw = wfGetDB( DB_MASTER );
* Update a search index record's title only.
* Title should be pre-processed.
*
* Update a search index record's title only.
* Title should be pre-processed.
*
- * @param $id Integer
- * @param $title String
+ * @param int $id
+ * @param string $title
*/
function updateTitle( $id, $title ) {
$dbw = wfGetDB( DB_MASTER );
*/
function updateTitle( $id, $title ) {
$dbw = wfGetDB( DB_MASTER );
* Currently searches a page's current title (page.page_title) and
* latest revision article text (pagecontent.old_text)
*
* Currently searches a page's current title (page.page_title) and
* latest revision article text (pagecontent.old_text)
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return PostgresSearchResultSet
*/
function searchTitle( $term ) {
* @return PostgresSearchResultSet
*/
function searchTitle( $term ) {
* Transform the user's search string into a better form for tsearch2
* Returns an SQL fragment consisting of quoted text to search for.
*
* Transform the user's search string into a better form for tsearch2
* Returns an SQL fragment consisting of quoted text to search for.
*
/**
* Construct the full SQL query to do the search.
/**
* Construct the full SQL query to do the search.
- * @param $term String
- * @param $fulltext String
- * @param $colname
+ * @param string $term
+ * @param string $fulltext
+ * @param string $colname
* @return string
*/
function searchQuery( $term, $fulltext, $colname ) {
* @return string
*/
function searchQuery( $term, $fulltext, $colname ) {
*/
protected $mText;
/**
* Return a new SearchResult and initializes it with a title.
*
*/
protected $mText;
/**
* Return a new SearchResult and initializes it with a title.
*
* @return SearchResult
*/
public static function newFromTitle( $title ) {
* @return SearchResult
*/
public static function newFromTitle( $title ) {
/**
* Return a new SearchResult and initializes it with a row.
*
/**
* Return a new SearchResult and initializes it with a row.
*
* @return SearchResult
*/
public static function newFromRow( $row ) {
* @return SearchResult
*/
public static function newFromRow( $row ) {
* Initialize from a database row. Makes a Title and passes that to
* initFromTitle.
*
* Initialize from a database row. Makes a Title and passes that to
* initFromTitle.
*
*/
protected function initFromRow( $row ) {
$this->initFromTitle( Title::makeTitle( $row->page_namespace, $row->page_title ) );
*/
protected function initFromRow( $row ) {
$this->initFromTitle( Title::makeTitle( $row->page_namespace, $row->page_title ) );
* Initialize from a Title and if possible initializes a corresponding
* Revision and File.
*
* Initialize from a Title and if possible initializes a corresponding
* Revision and File.
*
*/
protected function initFromTitle( $title ) {
$this->mTitle = $title;
*/
protected function initFromTitle( $title ) {
$this->mTitle = $title;
/**
* Check if this is result points to an invalid title
*
/**
* Check if this is result points to an invalid title
*
*/
function isBrokenTitle() {
return is_null( $this->mTitle );
*/
function isBrokenTitle() {
return is_null( $this->mTitle );
/**
* Check if target page is missing, happens when index is out of date
*
/**
* Check if target page is missing, happens when index is out of date
*
*/
function isMissingRevision() {
return !$this->mRevision && !$this->mImage;
*/
function isMissingRevision() {
return !$this->mRevision && !$this->mImage;
- * @return float|null if not supported
+ * @return float|null If not supported
*/
function getScore() {
return null;
*/
function getScore() {
return null;
- * @param array $terms terms to highlight
- * @return String: highlighted text snippet, null (and not '') if not supported
+ * @param array $terms Terms to highlight
+ * @return string Highlighted text snippet, null (and not '') if not supported
*/
function getTextSnippet( $terms ) {
global $wgAdvancedSearchHighlighting;
*/
function getTextSnippet( $terms ) {
global $wgAdvancedSearchHighlighting;
- * @return String: highlighted title, '' if not supported
+ * @return string Highlighted title, '' if not supported
*/
function getTitleSnippet() {
return '';
}
/**
*/
function getTitleSnippet() {
return '';
}
/**
- * @return String: highlighted redirect name (redirect to this page), '' if none or not supported
+ * @return string Highlighted redirect name (redirect to this page), '' if none or not supported
*/
function getRedirectSnippet() {
return '';
}
/**
*/
function getRedirectSnippet() {
return '';
}
/**
- * @return Title object for the redirect to this page, null if none or not supported
+ * @return Title Title object for the redirect to this page, null if none or not supported
*/
function getRedirectTitle() {
return null;
}
/**
*/
function getRedirectTitle() {
return null;
}
/**
- * @return string highlighted relevant section name, null if none or not supported
+ * @return string Highlighted relevant section name, null if none or not supported
*/
function getSectionSnippet() {
return '';
}
/**
*/
function getSectionSnippet() {
return '';
}
/**
- * @return Title object (pagename+fragment) for the section, null if none or not supported
+ * @return Title Title object (pagename+fragment) for the section, null if none or not supported
*/
function getSectionTitle() {
return null;
}
/**
*/
function getSectionTitle() {
return null;
}
/**
- * @return String: timestamp
+ * @return string timestamp
*/
function getTimestamp() {
if ( $this->mRevision ) {
*/
function getTimestamp() {
if ( $this->mRevision ) {
- * @return Integer: number of words
+ * @return int Number of words
*/
function getWordCount() {
$this->initText();
*/
function getWordCount() {
$this->initText();
- * @return Integer: size in bytes
+ * @return int Size in bytes
*/
function getByteSize() {
$this->initText();
*/
function getByteSize() {
$this->initText();
- * @return Boolean if hit has related articles
+ * @return bool If hit has related articles
*/
function hasRelated() {
return false;
}
/**
*/
function hasRelated() {
return false;
}
/**
- * @return String: interwiki prefix of the title (return iw even if title is broken)
+ * @return string Interwiki prefix of the title (return iw even if title is broken)
*/
function getInterwikiPrefix() {
return '';
}
/**
*/
function getInterwikiPrefix() {
return '';
}
/**
- * @return string interwiki namespace of the title (since we likely can't resolve it locally)
+ * @return string Interwiki namespace of the title (since we likely can't resolve it locally)
*/
function getInterwikiNamespaceText() {
return '';
*/
function getInterwikiNamespaceText() {
return '';
/**
* Did this match file contents (eg: PDF/DJVU)?
/**
* Did this match file contents (eg: PDF/DJVU)?
*/
function isFileMatch() {
return false;
*/
function isFileMatch() {
return false;
* the search terms as parsed by this engine in a text extract.
* STUB
*
* the search terms as parsed by this engine in a text extract.
* STUB
*
*/
function termMatches() {
return array();
*/
function termMatches() {
return array();
* Return true if results are included in this result set.
* STUB
*
* Return true if results are included in this result set.
* STUB
*
*/
function hasResults() {
return false;
*/
function hasResults() {
return false;
*
* Return null if no total hits number is supported.
*
*
* Return null if no total hits number is supported.
*
*/
function getTotalHits() {
return null;
*/
function getTotalHits() {
return null;
* Some search modes return a suggested alternate term if there are
* no exact hits. Returns true if there is one on this set.
*
* Some search modes return a suggested alternate term if there are
* no exact hits. Returns true if there is one on this set.
*
*/
function hasSuggestion() {
return false;
}
/**
*/
function hasSuggestion() {
return false;
}
/**
- * @return String: suggested query, null if none
+ * @return string Suggested query, null if none
*/
function getSuggestionQuery() {
return null;
}
/**
*/
function getSuggestionQuery() {
return null;
}
/**
- * @return String: HTML highlighted suggested query, '' if none
+ * @return string HTML highlighted suggested query, '' if none
*/
function getSuggestionSnippet() {
return '';
*/
function getSuggestionSnippet() {
return '';
/**
* Check if there are results on other wikis
*
/**
* Check if there are results on other wikis
*
*/
function hasInterwikiResults() {
return $this->getInterwikiResults() != null;
*/
function hasInterwikiResults() {
return $this->getInterwikiResults() != null;
* Did the search contain search syntax? If so, Special:Search won't offer
* the user a link to a create a page named by the search string because the
* name would contain the search syntax.
* Did the search contain search syntax? If so, Special:Search won't offer
* the user a link to a create a page named by the search string because the
* name would contain the search syntax.
*/
public function searchContainedSyntax() {
return false;
*/
public function searchContainedSyntax() {
return false;
private $fetched = false;
/**
private $fetched = false;
/**
- * @param $match mixed Title if matched, else null
+ * @param Title|null $match Title if matched, else null
*/
public function __construct( $match ) {
$this->result = $match;
*/
public function __construct( $match ) {
$this->result = $match;
class SearchSqlite extends SearchDatabase {
/**
* Whether fulltext search is supported by current schema
class SearchSqlite extends SearchDatabase {
/**
* Whether fulltext search is supported by current schema
*/
function fulltextSearchSupported() {
return $this->db->checkForEnabledSearch();
*/
function fulltextSearchSupported() {
return $this->db->checkForEnabledSearch();
/**
* Perform a full text search query and return a result set.
*
/**
* Perform a full text search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return SqliteSearchResultSet
*/
function searchText( $term ) {
* @return SqliteSearchResultSet
*/
function searchText( $term ) {
/**
* Perform a title-only search query and return a result set.
*
/**
* Perform a title-only search query and return a result set.
*
- * @param string $term raw search term
+ * @param string $term Raw search term
* @return SqliteSearchResultSet
*/
function searchTitle( $term ) {
* @return SqliteSearchResultSet
*/
function searchTitle( $term ) {
/**
* Return a partial WHERE clause to limit the search to the given namespaces
/**
* Return a partial WHERE clause to limit the search to the given namespaces
*/
function queryNamespaces() {
if ( is_null( $this->namespaces ) ) {
*/
function queryNamespaces() {
if ( is_null( $this->namespaces ) ) {
/**
* Returns a query with limit for number of results set.
/**
* Returns a query with limit for number of results set.
- * @param $sql String:
- * @return String
+ * @param string $sql
+ * @return string
*/
function limitResult( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
*/
function limitResult( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
/**
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
/**
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return String
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return string
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->limitResult(
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->limitResult(
/**
* Picks which field to index on, depending on what type of query.
/**
* Picks which field to index on, depending on what type of query.
- * @param $fulltext Boolean
- * @return String
+ * @param bool $fulltext
+ * @return string
*/
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
*/
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
/**
* Get the base part of the search query.
*
/**
* Get the base part of the search query.
*
- * @param $filteredTerm String
- * @param $fulltext Boolean
- * @return String
+ * @param string $filteredTerm
+ * @param bool $fulltext
+ * @return string
*/
function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
*/
function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
* Create or update the search index record for the given page.
* Title and text should be pre-processed.
*
- * @param $id Integer
- * @param $title String
- * @param $text String
+ * @param int $id
+ * @param string $title
+ * @param string $text
*/
function update( $id, $title, $text ) {
if ( !$this->fulltextSearchSupported() ) {
*/
function update( $id, $title, $text ) {
if ( !$this->fulltextSearchSupported() ) {
* Update a search index record's title only.
* Title should be pre-processed.
*
* Update a search index record's title only.
* Title should be pre-processed.
*
- * @param $id Integer
- * @param $title String
+ * @param int $id
+ * @param string $title
*/
function updateTitle( $id, $title ) {
if ( !$this->fulltextSearchSupported() ) {
*/
function updateTitle( $id, $title ) {
if ( !$this->fulltextSearchSupported() ) {