Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/371005 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: I8e656d2fdf324e768cd173e73f92a63bbc41ef39 --- M TitleBlacklist.hooks.php M TitleBlacklist.list.php M api/ApiQueryTitleBlacklist.php M phpcs.xml 4 files changed, 56 insertions(+), 37 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TitleBlacklist refs/changes/05/371005/1 diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php index 3648d5b..6e1b75c 100644 --- a/TitleBlacklist.hooks.php +++ b/TitleBlacklist.hooks.php @@ -37,10 +37,10 @@ /** * getUserPermissionsErrorsExpensive hook * - * @param $title Title - * @param $user User - * @param $action - * @param $result + * @param Title $title + * @param User $user + * @param string $action + * @param array &$result * @return bool */ public static function userCan( $title, $user, $action, &$result ) { @@ -90,8 +90,9 @@ * because they have tboverride. * * @param Title $title - * @param integer $oldid + * @param int $oldid * @param array &$notices + * @return true */ public static function displayBlacklistOverrideNotice( Title $title, $oldid, array &$notices ) { if ( !RequestContext::getMain()->getUser()->isAllowed( 'tboverride' ) ) { @@ -123,7 +124,7 @@ * @param Title $oldTitle * @param Title $newTitle * @param User $user - * @param $reason + * @param string $reason * @param Status $status * @return bool */ @@ -155,6 +156,11 @@ * Used by abortNewAccount and centralAuthAutoCreate. * May also be called externally to vet alternate account names. * + * @param string $userName + * @param User $permissionsUser + * @param string &$err + * @param bool $override + * @param bool $log * @return bool Acceptable */ public static function acceptNewUserName( @@ -215,7 +221,7 @@ * * @param User $user * @param string &$message - * @param Status $status + * @param Status &$status * @return bool */ public static function abortNewAccount( $user, &$message, &$status ) { @@ -247,7 +253,11 @@ /** * EditFilter hook * - * @param $editor EditPage + * @param EditPage $editor + * @param string $text + * @param string $section + * @param string &$error + * @return true */ public static function validateBlacklist( $editor, $text, $section, &$error ) { $title = $editor->mTitle; @@ -279,7 +289,14 @@ /** * PageContentSaveComplete hook * - * @param Article $article + * @param Article &$article + * @param User &$user + * @param Content $content + * @param string $summary + * @param bool $isminor + * @param bool $iswatch + * @param string $section + * @return true */ public static function clearBlacklist( &$article, &$user, $content, $summary, $isminor, $iswatch, $section @@ -291,7 +308,11 @@ return true; } - /** UserCreateForm hook based on the one from AntiSpoof extension */ + /** + * UserCreateForm hook based on the one from AntiSpoof extension + * @param UsercreateTemplate &$template + * @return true + */ public static function addOverrideCheckbox( &$template ) { global $wgRequest, $wgUser; @@ -304,8 +325,8 @@ } /** - * @param ApiBase $module - * @param array $params + * @param ApiBase &$module + * @param array &$params * @return bool */ public static function onAPIGetAllowedParams( ApiBase &$module, array &$params ) { @@ -367,7 +388,7 @@ * External Lua library for Scribunto * * @param string $engine - * @param array $extraLibraries + * @param array &$extraLibraries * @return bool */ public static function scribuntoExternalLibraries( $engine, array &$extraLibraries ) { diff --git a/TitleBlacklist.list.php b/TitleBlacklist.list.php index b7b29ae..57f526d 100644 --- a/TitleBlacklist.list.php +++ b/TitleBlacklist.list.php @@ -153,7 +153,8 @@ /** * Parse blacklist from a string * - * @param $list string Text of a blacklist source + * @param string $list Text of a blacklist source + * @param string $sourceName * @return array of TitleBlacklistEntry entries */ public static function parseBlacklist( $list, $sourceName ) { @@ -173,10 +174,10 @@ * Check whether the blacklist restricts given user * performing a specific action on the given Title * - * @param $title Title to check - * @param $user User to check - * @param $action string Action to check; 'edit' if unspecified - * @param $override bool If set to true, overrides work + * @param Title $title Title to check + * @param User $user User to check + * @param string $action Action to check; 'edit' if unspecified + * @param bool $override If set to true, overrides work * @return TitleBlacklistEntry|bool The corresponding TitleBlacklistEntry if * blacklisted; otherwise false */ @@ -199,8 +200,8 @@ * Check whether the blacklist restricts * performing a specific action on the given Title * - * @param $title Title to check - * @param $action string Action to check; 'edit' if unspecified + * @param Title $title Title to check + * @param string $action Action to check; 'edit' if unspecified * @return TitleBlacklistEntry|bool The corresponding TitleBlacklistEntry if blacklisted; * otherwise FALSE */ @@ -236,8 +237,8 @@ * Check whether it has been explicitly whitelisted that the * current User may perform a specific action on the given Title * - * @param $title Title to check - * @param $action string Action to check; 'edit' if unspecified + * @param Title $title Title to check + * @param string $action Action to check; 'edit' if unspecified * @return bool True if whitelisted; otherwise false */ public function isWhitelisted( $title, $action = 'edit' ) { @@ -280,7 +281,7 @@ /** * Get the text of a blacklist source via HTTP * - * @param $url string URL of the blacklist source + * @param string $url URL of the blacklist source * @return string The content of the blacklist source as a string */ private static function getHttp( $url ) { @@ -310,7 +311,7 @@ /** * Validate a new blacklist * - * @param $blacklist array + * @param array $blacklist * @return Array of bad entries; empty array means blacklist is valid */ public function validate( $blacklist ) { @@ -329,7 +330,8 @@ /** * Inidcates whether user can override blacklist on certain action. * - * @param $action Action + * @param User $user + * @param string $action Action * * @return bool */ @@ -376,9 +378,9 @@ /** * Construct a new TitleBlacklistEntry. * - * @param $regex string Regular expression to match - * @param $params array Parameters for this entry - * @param $raw string Raw contents of this line + * @param string $regex Regular expression to match + * @param array $params Parameters for this entry + * @param string $raw Raw contents of this line */ private function __construct( $regex, $params, $raw, $source ) { $this->mRaw = $raw; @@ -481,7 +483,8 @@ /** * Create a new TitleBlacklistEntry from a line of text * - * @param $line String containing a line of blacklist text + * @param string $line String containing a line of blacklist text + * @param string $source * @return TitleBlacklistEntry|null */ public static function newFromString( $line, $source ) { @@ -596,7 +599,7 @@ /** * Set the format version * - * @param $v string New version to set + * @param string $v New version to set */ public function setFormatVersion( $v ) { $this->mFormatVersion = $v; @@ -605,7 +608,7 @@ /** * Return the error message name for the blacklist entry. * - * @param $operation string Operation name (as in titleblacklist-forbidden message name) + * @param string $operation Operation name (as in titleblacklist-forbidden message name) * * @return string The error message name */ diff --git a/api/ApiQueryTitleBlacklist.php b/api/ApiQueryTitleBlacklist.php index 53dab84..443f75a 100644 --- a/api/ApiQueryTitleBlacklist.php +++ b/api/ApiQueryTitleBlacklist.php @@ -98,6 +98,7 @@ /** * @see ApiBase::getExamplesMessages() + * @return array */ protected function getExamplesMessages() { return [ diff --git a/phpcs.xml b/phpcs.xml index 7b090c4..ed56aa9 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -3,10 +3,6 @@ <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <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.MissingReturn" /> - <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" /> <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/> </rule> @@ -18,6 +14,4 @@ <file>.</file> <arg name="extensions" value="php,php5,inc"/> <arg name="encoding" value="UTF-8"/> - <exclude-pattern>vendor</exclude-pattern> - <exclude-pattern>node_modules</exclude-pattern> </ruleset> -- To view, visit https://gerrit.wikimedia.org/r/371005 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e656d2fdf324e768cd173e73f92a63bbc41ef39 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TitleBlacklist Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits