From dcf6955e5c7e5dd1aaf84b9fe207d0660fc577cd Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 20 Apr 2014 23:33:05 +0200 Subject: [PATCH] Fixed some @params documentation (includes/*) 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 --- includes/htmlform/HTMLButtonField.php | 6 +- includes/htmlform/HTMLCheckField.php | 7 +- includes/htmlform/HTMLCheckMatrix.php | 12 +- includes/htmlform/HTMLForm.php | 103 +++++++++--------- includes/htmlform/HTMLFormField.php | 15 ++- includes/htmlform/HTMLMultiSelectField.php | 4 +- includes/htmlform/HTMLNestedFilterable.php | 2 +- includes/htmlform/HTMLRadioField.php | 4 +- includes/htmlform/HTMLSelectAndOtherField.php | 4 +- includes/htmlform/HTMLSelectOrOtherField.php | 4 +- includes/jobqueue/Job.php | 14 +-- includes/jobqueue/JobQueue.php | 2 +- includes/jobqueue/JobQueueDB.php | 12 +- includes/jobqueue/JobQueueFederated.php | 2 +- includes/jobqueue/JobQueueGroup.php | 4 +- includes/jobqueue/JobQueueRedis.php | 22 ++-- includes/jobqueue/jobs/DoubleRedirectJob.php | 8 +- includes/jobqueue/jobs/RefreshLinksJob2.php | 10 +- includes/jobqueue/jobs/UploadFromUrlJob.php | 2 +- includes/resourceloader/ResourceLoader.php | 28 ++--- .../resourceloader/ResourceLoaderContext.php | 10 +- .../ResourceLoaderFileModule.php | 78 ++++++------- .../ResourceLoaderFilePageModule.php | 2 +- .../ResourceLoaderLanguageDataModule.php | 12 +- .../resourceloader/ResourceLoaderModule.php | 44 ++++---- .../ResourceLoaderNoscriptModule.php | 6 +- .../ResourceLoaderSiteModule.php | 6 +- .../ResourceLoaderStartUpModule.php | 6 +- .../ResourceLoaderUserCSSPrefsModule.php | 6 +- .../ResourceLoaderUserGroupsModule.php | 2 +- .../ResourceLoaderUserModule.php | 2 +- .../ResourceLoaderUserOptionsModule.php | 6 +- .../ResourceLoaderUserTokensModule.php | 4 +- .../ResourceLoaderWikiModule.php | 16 +-- includes/search/SearchEngine.php | 64 +++++------ includes/search/SearchHighlighter.php | 60 +++++----- includes/search/SearchMssql.php | 36 +++--- includes/search/SearchMySQL.php | 44 ++++---- includes/search/SearchOracle.php | 38 +++---- includes/search/SearchPostgres.php | 10 +- includes/search/SearchResult.php | 43 ++++---- includes/search/SearchResultSet.php | 17 +-- includes/search/SearchSqlite.php | 38 +++---- 43 files changed, 408 insertions(+), 407 deletions(-) diff --git a/includes/htmlform/HTMLButtonField.php b/includes/htmlform/HTMLButtonField.php index f8d017c685..09c0ad97e4 100644 --- a/includes/htmlform/HTMLButtonField.php +++ b/includes/htmlform/HTMLButtonField.php @@ -31,10 +31,10 @@ class HTMLButtonField extends HTMLFormField { /** * Button cannot be invalid * - * @param $value String - * @param $alldata Array + * @param string $value + * @param array $alldata * - * @return Bool + * @return bool */ public function validate( $value, $alldata ) { return true; diff --git a/includes/htmlform/HTMLCheckField.php b/includes/htmlform/HTMLCheckField.php index 7baab66f07..c7ec014772 100644 --- a/includes/htmlform/HTMLCheckField.php +++ b/includes/htmlform/HTMLCheckField.php @@ -36,7 +36,7 @@ class HTMLCheckField extends HTMLFormField { /** * For a checkbox, the label goes on the right hand side, and is * added in getInputHTML(), rather than HTMLFormField::getRow() - * @return String + * @return string */ function getLabel() { return ' '; @@ -44,15 +44,16 @@ class HTMLCheckField extends HTMLFormField { /** * checkboxes don't need a label. + * @return bool */ protected function needsLabel() { return false; } /** - * @param $request WebRequest + * @param WebRequest $request * - * @return String + * @return string */ function loadDataFromRequest( $request ) { $invert = false; diff --git a/includes/htmlform/HTMLCheckMatrix.php b/includes/htmlform/HTMLCheckMatrix.php index 2fc170c83e..606523b6ad 100644 --- a/includes/htmlform/HTMLCheckMatrix.php +++ b/includes/htmlform/HTMLCheckMatrix.php @@ -75,9 +75,9 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { * 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 * - * @return String + * @return string */ function getInputHTML( $value ) { $html = ''; @@ -159,9 +159,9 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { * 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 ); @@ -187,9 +187,9 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { } /** - * @param $request WebRequest + * @param WebRequest $request * - * @return Array + * @return array */ function loadDataFromRequest( $request ) { if ( $this->mParent->getMethod() == 'post' ) { diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 21505a8ad3..c7bac0d0a9 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -181,13 +181,13 @@ class HTMLForm extends ContextSource { /** * Format in which to display form. For viable options, * @see $availableDisplayFormats - * @var String + * @var string */ protected $displayFormat = 'table'; /** * Available formats in which to display the form - * @var Array + * @var array */ protected $availableDisplayFormats = array( 'table', @@ -199,10 +199,10 @@ class HTMLForm extends ContextSource { /** * 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() - * @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 = '' @@ -267,8 +267,8 @@ class HTMLForm extends ContextSource { /** * 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 @@ -287,7 +287,7 @@ class HTMLForm extends ContextSource { /** * Getter for displayFormat * @since 1.20 - * @return String + * @return string */ public function getDisplayFormat() { return $this->displayFormat; @@ -296,7 +296,7 @@ class HTMLForm extends ContextSource { /** * Test if displayFormat is 'vform' * @since 1.22 - * @return Bool + * @return bool */ public function isVForm() { return $this->displayFormat === 'vform'; @@ -388,7 +388,7 @@ class HTMLForm extends ContextSource { /** * Try submitting, with edit token check first - * @return Status|boolean + * @return Status|bool */ function tryAuthorizedSubmit() { $result = false; @@ -419,7 +419,7 @@ class HTMLForm extends ContextSource { * 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(); @@ -438,7 +438,7 @@ class HTMLForm extends ContextSource { * 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. */ @@ -476,7 +476,7 @@ class HTMLForm extends ContextSource { * 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. @@ -492,7 +492,7 @@ class HTMLForm extends ContextSource { /** * 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) @@ -506,7 +506,7 @@ class HTMLForm extends ContextSource { /** * 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) */ @@ -520,7 +520,7 @@ class HTMLForm extends ContextSource { * 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) */ @@ -533,7 +533,7 @@ class HTMLForm extends ContextSource { /** * 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) */ @@ -546,7 +546,7 @@ class HTMLForm extends ContextSource { /** * 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) @@ -568,8 +568,8 @@ class HTMLForm extends ContextSource { * 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) */ @@ -608,7 +608,7 @@ class HTMLForm extends ContextSource { * 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) @@ -626,7 +626,7 @@ class HTMLForm extends ContextSource { /** * 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) */ @@ -639,7 +639,7 @@ class HTMLForm extends ContextSource { /** * 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) */ @@ -652,9 +652,9 @@ class HTMLForm extends ContextSource { /** * 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) */ @@ -686,10 +686,10 @@ class HTMLForm extends ContextSource { /** * 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 $attribs Array + * @param array $attribs * * @return HTMLForm $this for chaining calls (since 1.20) */ @@ -707,7 +707,7 @@ class HTMLForm extends ContextSource { * 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 */ @@ -718,7 +718,7 @@ class HTMLForm extends ContextSource { /** * Returns the raw HTML generated by the form * - * @param $submitResult Mixed output from HTMLForm::trySubmit() + * @param mixed $submitResult Mixed output from HTMLForm::trySubmit() * * @return string */ @@ -753,7 +753,7 @@ class HTMLForm extends ContextSource { * * @param string $html HTML contents to wrap. * - * @return String wrapped HTML. + * @return string Wrapped HTML. */ function wrapForm( $html ) { @@ -785,7 +785,7 @@ class HTMLForm extends ContextSource { /** * Get the hidden fields that should go inside the form. - * @return String HTML. + * @return string HTML. */ function getHiddenFields() { global $wgArticlePath; @@ -814,7 +814,7 @@ class HTMLForm extends ContextSource { /** * Get the submit and (potentially) reset buttons. - * @return String HTML. + * @return string HTML. */ function getButtons() { $buttons = ''; @@ -895,7 +895,7 @@ class HTMLForm extends ContextSource { /** * Get the whole body of the form. - * @return String + * @return string */ function getBody() { return $this->displaySection( $this->mFieldTree, $this->mTableId ); @@ -904,9 +904,9 @@ class HTMLForm extends ContextSource { /** * Format and display an error message stack. * - * @param $errors String|Array|Status + * @param string|array|Status $errors * - * @return String + * @return string */ function getErrors( $errors ) { if ( $errors instanceof Status ) { @@ -931,7 +931,7 @@ class HTMLForm extends ContextSource { * * @param array $errors of message keys/values * - * @return String HTML, a "