jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/403717 )
Change subject: Improve some parameter docs
......................................................................
Improve some parameter docs
Change-Id: I964cfc2d2563e617a195d6b2b6f0acab4dea4efc
---
M .phpcs.xml
M ConfirmAccount.setup.php
M backend/ConfirmAccount.class.php
M backend/UserAccountRequest.php
M business/AccountConfirmSubmission.php
M business/AccountRequestSubmission.php
M frontend/ConfirmAccountUI.hooks.php
M frontend/ConfirmAccountUI.setup.php
M frontend/specialpages/actions/ConfirmAccount_body.php
M frontend/specialpages/actions/ConfirmAccountsPager.php
M frontend/specialpages/actions/RequestAccount_body.php
M frontend/specialpages/actions/UserCredentials_body.php
12 files changed, 51 insertions(+), 58 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.phpcs.xml b/.phpcs.xml
index 31951f0..bcfe27a 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -4,9 +4,6 @@
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
<exclude
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
<exclude name="Squiz.Scope.MethodScope.Missing" />
diff --git a/ConfirmAccount.setup.php b/ConfirmAccount.setup.php
index 31497e0..4c6023f 100644
--- a/ConfirmAccount.setup.php
+++ b/ConfirmAccount.setup.php
@@ -7,10 +7,9 @@
* Register source code paths.
* This function must NOT depend on any config vars.
*
- * @param $classes Array $classes
- * @param $messagesDirs Array $messagesDirs
- * @param $messagesFiles Array $messagesFiles
- * @return void
+ * @param array &$classes
+ * @param array &$messagesDirs
+ * @param array &$messagesFiles
*/
public static function defineSourcePaths(
array &$classes, array &$messagesDirs, array &$messagesFiles
diff --git a/backend/ConfirmAccount.class.php b/backend/ConfirmAccount.class.php
index 39c635d..c9aa4a3 100644
--- a/backend/ConfirmAccount.class.php
+++ b/backend/ConfirmAccount.class.php
@@ -82,7 +82,7 @@
* Generate, store, and return a new email confirmation code.
* A hash (unsalted since it's used as a key) is stored.
* @param User $user
- * @param string $expiration
+ * @param string &$expiration
* @return string
*/
public static function getConfirmationToken( $user, &$expiration ) {
@@ -125,7 +125,7 @@
/**
* Get a request name from an email confirmation token
*
- * @param $code string
+ * @param string $code
* @return string|false
*/
public static function requestNameFromEmailToken( $code ) {
@@ -141,8 +141,8 @@
/**
* Get the number of account requests for a request type
- * @param $type int
- * @return Array Assosiative array with 'open', 'held', 'type' keys
mapping to integers
+ * @param int $type
+ * @return array Assosiative array with 'open', 'held', 'type' keys
mapping to integers
*/
public static function getOpenRequestCount( $type ) {
$dbr = wfGetDB( DB_REPLICA );
@@ -163,7 +163,7 @@
/**
* Get the number of open email-confirmed account requests for a
request type
- * @param $type int|string A request type or '*' for all
+ * @param int|string $type A request type or '*' for all
* @return int
*/
public static function getOpenEmailConfirmedCount( $type = '*' ) {
diff --git a/backend/UserAccountRequest.php b/backend/UserAccountRequest.php
index e24da51..2481648 100644
--- a/backend/UserAccountRequest.php
+++ b/backend/UserAccountRequest.php
@@ -32,7 +32,7 @@
}
/**
- * @param $row
+ * @param stdClass $row
* @return UserAccountRequest
*/
public static function newFromRow( $row ) {
@@ -68,7 +68,7 @@
}
/**
- * @param $fields array
+ * @param array $fields
* @return UserAccountRequest
*/
public static function newFromArray( array $fields ) {
@@ -121,8 +121,8 @@
}
/**
- * @param $id int
- * @param $from string|null 'dbmaster' to use DB master
+ * @param int $id
+ * @param string|null $from 'dbmaster' to use DB master
* @return UserAccountRequest|null
*/
public static function newFromId( $id, $from = null ) {
@@ -137,8 +137,8 @@
}
/**
- * @param $name string
- * @param $from string|null 'dbmaster' to use DB master
+ * @param string $name
+ * @param string|null $from 'dbmaster' to use DB master
* @return UserAccountRequest|null
*/
public static function newFromName( $name, $from = null ) {
@@ -209,7 +209,7 @@
}
/**
- * @param $flat string Use 'flat' to get a raw blob back
+ * @param string $flat Use 'flat' to get a raw blob back
* @return array|string Flat blob or array from expanded blob
*/
public function getAreas( $flat = 'expanded' ) {
@@ -364,9 +364,9 @@
/**
* Mark this request as rejected
- * @param $admin User
- * @param $timestamp string
- * @param $reason string
+ * @param User $admin
+ * @param string $timestamp
+ * @param string $reason
* @return bool Success
*/
public function markRejected( User $admin, $timestamp, $reason = '' ) {
@@ -385,9 +385,9 @@
/**
* Mark this request as held
- * @param $admin User
- * @param $timestamp string
- * @param $reason string
+ * @param User $admin
+ * @param string $timestamp
+ * @param string $reason
* @return bool Success
*/
public function markHeld( User $admin, $timestamp, $reason = '' ) {
@@ -419,6 +419,7 @@
/**
* Try to acquire a username in the request queue for insertion
+ * @param string $name
* @return bool
*/
public static function acquireUsername( $name ) {
@@ -433,6 +434,7 @@
/**
* Try to acquire an email address in the request queue for insertion
+ * @param string $email
* @return bool
*/
public static function acquireEmail( $email ) {
@@ -448,7 +450,7 @@
/**
* Flatten areas of interest array
* Used by ConfirmAccountsPage
- * @param $areas Array
+ * @param array $areas
* @todo just serialize()
* @return string
*/
@@ -463,7 +465,7 @@
/**
* Expand areas of interest to array
* Used by ConfirmAccountsPage
- * @param $areas string
+ * @param string $areas
* @todo just unserialize()
* @return Array
*/
@@ -479,7 +481,7 @@
/**
* Get path relative to zone for an account request attachment file.
* This assures compatibility with the old FileStore sytem.
- * @param $key string File storage key
+ * @param string $key File storage key
* @return string
*/
public static function relPathFromKey( $key ) {
diff --git a/business/AccountConfirmSubmission.php
b/business/AccountConfirmSubmission.php
index 1e63fbd..fa87e98 100644
--- a/business/AccountConfirmSubmission.php
+++ b/business/AccountConfirmSubmission.php
@@ -32,7 +32,7 @@
/**
* Attempt to validate and submit this data to the DB
- * @param $context IContextSource
+ * @param IContextSource $context
* @return array [ true or error key string, html error msg or null,
redirect URL ]
*/
public function submit( IContextSource $context ) {
diff --git a/business/AccountRequestSubmission.php
b/business/AccountRequestSubmission.php
index 380386d..9691df1 100644
--- a/business/AccountRequestSubmission.php
+++ b/business/AccountRequestSubmission.php
@@ -65,7 +65,7 @@
/**
* Attempt to validate and submit this data to the DB
- * @param $context IContextSource
+ * @param IContextSource $context
* @return array [ true or error key string, html error msg or null ]
*/
public function submit( IContextSource $context ) {
diff --git a/frontend/ConfirmAccountUI.hooks.php
b/frontend/ConfirmAccountUI.hooks.php
index 5d1651c..e1d3a06 100644
--- a/frontend/ConfirmAccountUI.hooks.php
+++ b/frontend/ConfirmAccountUI.hooks.php
@@ -4,7 +4,7 @@
*/
class ConfirmAccountUIHooks {
/**
- * @param $template
+ * @param SkinTemplate &$template
* @return bool
*/
public static function addRequestLoginText( &$template ) {
@@ -19,9 +19,9 @@
}
/**
- * @param $personal_urls
- * @param $title
- * @param $skin
+ * @param array &$personal_urls
+ * @param Title $title
+ * @param SkinTemplate $skin
* @return bool
*/
public static function setRequestLoginLinks(
@@ -39,8 +39,8 @@
/**
* Add "x email-confirmed open account requests" notice
- * @param OutputPage $out
- * @param Skin $skin
+ * @param OutputPage &$out
+ * @param Skin &$skin
* @return bool
*/
public static function confirmAccountsNotice( OutputPage &$out, Skin
&$skin ) {
@@ -70,7 +70,7 @@
/**
* For AdminLinks extension
- * @param $admin_links_tree
+ * @param ALTree &$admin_links_tree
* @return bool
*/
public static function confirmAccountAdminLinks( &$admin_links_tree ) {
@@ -91,7 +91,7 @@
/**
* @param array $requests
* @param array $fieldInfo
- * @param array $formDescriptor
+ * @param array &$formDescriptor
* @param string $action
* @return bool
* @throws ErrorPageError
diff --git a/frontend/ConfirmAccountUI.setup.php
b/frontend/ConfirmAccountUI.setup.php
index 5924fca..a1d29dd 100644
--- a/frontend/ConfirmAccountUI.setup.php
+++ b/frontend/ConfirmAccountUI.setup.php
@@ -5,8 +5,7 @@
class ConfirmAccountUISetup {
/**
* Register ConfirmAccount hooks.
- * @param $hooks array $wgHooks (assoc array of hooks and handlers)
- * @return void
+ * @param array &$hooks $wgHooks (assoc array of hooks and handlers)
*/
public static function defineHookHandlers( array &$hooks ) {
# Make sure "login / create account" notice still as "create
account"
@@ -24,8 +23,7 @@
/**
* Register ConfirmAccount special pages as needed.
- * @param $pages array $wgSpecialPages (list of special pages)
- * @return void
+ * @param array &$pages $wgSpecialPages (list of special pages)
*/
public static function defineSpecialPages( array &$pages ) {
$pages['RequestAccount'] = 'RequestAccountPage';
@@ -35,8 +33,7 @@
/**
* Append ConfirmAccount resource module definitions
- * @param $modules array $wgResourceModules
- * @return void
+ * @param array &$modules $wgResourceModules
*/
public static function defineResourceModules( array &$modules ) {
$modules['ext.confirmAccount'] = [
diff --git a/frontend/specialpages/actions/ConfirmAccount_body.php
b/frontend/specialpages/actions/ConfirmAccount_body.php
index f8ecd0c..c919491 100644
--- a/frontend/specialpages/actions/ConfirmAccount_body.php
+++ b/frontend/specialpages/actions/ConfirmAccount_body.php
@@ -256,7 +256,7 @@
}
/**
- * @param $msg string
+ * @param string $msg
*/
protected function showAccountConfirmForm( $msg = '' ) {
global $wgAccountRequestTypes;
@@ -530,7 +530,7 @@
/**
* Show a private file requested by the visitor.
- * @param $key string
+ * @param string $key
*/
protected function showFile( $key ) {
global $wgConfirmAccountFSRepos;
@@ -600,9 +600,8 @@
/**
* Get requested account request row and load some fields
- * @param $id int
- * @param $wasPosted bool
- * @return void
+ * @param int $id
+ * @param bool $wasPosted
*/
protected function loadAccountRequest( $id, $wasPosted ) {
$from = $wasPosted ? 'dbmaster' : 'dbslave';
@@ -673,9 +672,9 @@
}
/**
- * @param $submitType string
- * @param $name string User name
- * @param $errors array
+ * @param string $submitType
+ * @param string $name User name
+ * @param array $errors
*/
protected function showSuccess( $submitType, $name = null, $errors = []
) {
$out = $this->getOutput();
@@ -734,7 +733,7 @@
}
/**
- * @param $row
+ * @param stdClass $row
* @return string
*/
public function formatRow( $row ) {
diff --git a/frontend/specialpages/actions/ConfirmAccountsPager.php
b/frontend/specialpages/actions/ConfirmAccountsPager.php
index 2c09345..d9228ab 100644
--- a/frontend/specialpages/actions/ConfirmAccountsPager.php
+++ b/frontend/specialpages/actions/ConfirmAccountsPager.php
@@ -41,7 +41,7 @@
}
/**
- * @param $row
+ * @param stdClass $row
* @return string
*/
function formatRow( $row ) {
diff --git a/frontend/specialpages/actions/RequestAccount_body.php
b/frontend/specialpages/actions/RequestAccount_body.php
index d15754a..d48b687 100644
--- a/frontend/specialpages/actions/RequestAccount_body.php
+++ b/frontend/specialpages/actions/RequestAccount_body.php
@@ -362,7 +362,7 @@
/**
* Initialize the uploaded file from PHP data
- * @param $request WebRequest
+ * @param WebRequest $request
*/
protected function initializeUpload( $request ) {
$file = new WebRequestUpload( $request, 'wpUploadFile' );
@@ -374,7 +374,7 @@
/**
* (a) Try to confirm an email address via a token
* (b) Notify $wgConfirmAccountContact on success
- * @param $code string The token
+ * @param string $code The token
* @return void
*/
protected function confirmEmailToken( $code ) {
diff --git a/frontend/specialpages/actions/UserCredentials_body.php
b/frontend/specialpages/actions/UserCredentials_body.php
index 053efde..fad8015 100644
--- a/frontend/specialpages/actions/UserCredentials_body.php
+++ b/frontend/specialpages/actions/UserCredentials_body.php
@@ -212,8 +212,7 @@
/**
* Show a private file requested by the visitor.
- * @param $key string
- * @return void
+ * @param string $key
*/
function showFile( $key ) {
global $wgConfirmAccountFSRepos;
--
To view, visit https://gerrit.wikimedia.org/r/403717
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I964cfc2d2563e617a195d6b2b6f0acab4dea4efc
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ConfirmAccount
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits