mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-11 16:50:06 +00:00
Improve some parameter docs
Change-Id: I2f2027eb1abec05238f36f111dfc35013aa016e2
This commit is contained in:
parent
09f08e8c16
commit
77e4b9db61
|
@ -74,8 +74,8 @@ abstract class BaseBlacklist {
|
|||
/**
|
||||
* Adds a blacklist class to the registry
|
||||
*
|
||||
* @param $type string
|
||||
* @param $class string
|
||||
* @param string $type
|
||||
* @param string $class
|
||||
*/
|
||||
public static function addBlacklistType( $type, $class ) {
|
||||
self::$blacklistTypes[$type] = $class;
|
||||
|
@ -93,7 +93,7 @@ abstract class BaseBlacklist {
|
|||
/**
|
||||
* Returns an instance of the given blacklist
|
||||
*
|
||||
* @param $type string Code for the blacklist
|
||||
* @param string $type Code for the blacklist
|
||||
* @return BaseBlacklist
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -405,7 +405,7 @@ abstract class BaseBlacklist {
|
|||
/**
|
||||
* Returns the end of the regex for matches
|
||||
*
|
||||
* @param $batchSize
|
||||
* @param int $batchSize
|
||||
* @return string
|
||||
*/
|
||||
public function getRegexEnd( $batchSize ) {
|
||||
|
|
|
@ -83,8 +83,8 @@ class SpamBlacklistHooks {
|
|||
/**
|
||||
* Verify that the user can send emails
|
||||
*
|
||||
* @param $user User
|
||||
* @param $hookErr array
|
||||
* @param User &$user
|
||||
* @param array &$hookErr
|
||||
* @return bool
|
||||
*/
|
||||
public static function userCanSendEmail( &$user, &$hookErr ) {
|
||||
|
@ -102,8 +102,8 @@ class SpamBlacklistHooks {
|
|||
/**
|
||||
* Processes new accounts for valid email addresses
|
||||
*
|
||||
* @param $user User
|
||||
* @param $abortError
|
||||
* @param User $user
|
||||
* @param string &$abortError
|
||||
* @return bool
|
||||
*/
|
||||
public static function abortNewAccount( $user, &$abortError ) {
|
||||
|
@ -125,7 +125,7 @@ class SpamBlacklistHooks {
|
|||
* @param EditPage $editPage
|
||||
* @param string $text
|
||||
* @param string $section
|
||||
* @param string $hookError
|
||||
* @param string &$hookError
|
||||
* @return bool
|
||||
*/
|
||||
static function validate( EditPage $editPage, $text, $section, &$hookError ) {
|
||||
|
@ -276,10 +276,10 @@ class SpamBlacklistHooks {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param WikiPage $article
|
||||
* @param User $user
|
||||
* @param $reason
|
||||
* @param $error
|
||||
* @param WikiPage &$article
|
||||
* @param User &$user
|
||||
* @param string &$reason
|
||||
* @param string &$error
|
||||
*/
|
||||
public static function onArticleDelete( WikiPage &$article, User &$user, &$reason, &$error ) {
|
||||
/** @var SpamBlacklist $spam */
|
||||
|
@ -295,10 +295,10 @@ class SpamBlacklistHooks {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param WikiPage $page
|
||||
* @param User $user
|
||||
* @param $reason
|
||||
* @param $id
|
||||
* @param WikiPage &$page
|
||||
* @param User &$user
|
||||
* @param string $reason
|
||||
* @param int $id
|
||||
* @param Content|null $content
|
||||
* @param LogEntry $logEntry
|
||||
*/
|
||||
|
|
|
@ -265,7 +265,7 @@ class SpamBlacklist extends BaseBlacklist {
|
|||
* ignore them on a second run.
|
||||
*
|
||||
* WARNING: I can add more *of the same link* with no problem here.
|
||||
* @param $title Title
|
||||
* @param Title $title
|
||||
* @return array
|
||||
*/
|
||||
function getCurrentLinks( Title $title ) {
|
||||
|
@ -304,7 +304,7 @@ class SpamBlacklist extends BaseBlacklist {
|
|||
/**
|
||||
* Returns the end of the regex for matches
|
||||
*
|
||||
* @param $batchSize
|
||||
* @param int $batchSize
|
||||
* @return string
|
||||
*/
|
||||
public function getRegexEnd( $batchSize ) {
|
||||
|
|
|
@ -55,7 +55,7 @@ class SpamRegexBatch {
|
|||
/**
|
||||
* Confirm that a set of regexes is either empty or valid.
|
||||
*
|
||||
* @param $regexes array set of regexes
|
||||
* @param array $regexes set of regexes
|
||||
* @return bool true if ok, false if contains invalid lines
|
||||
*/
|
||||
static function validateRegexes( $regexes ) {
|
||||
|
@ -74,7 +74,7 @@ class SpamRegexBatch {
|
|||
/**
|
||||
* Strip comments and whitespace, then remove blanks
|
||||
*
|
||||
* @param $lines array
|
||||
* @param array $lines
|
||||
* @return array
|
||||
*/
|
||||
static function stripLines( $lines ) {
|
||||
|
@ -87,9 +87,9 @@ class SpamRegexBatch {
|
|||
/**
|
||||
* Do a sanity check on the batch regex.
|
||||
*
|
||||
* @param $lines string unsanitized input lines
|
||||
* @param $blacklist BaseBlacklist
|
||||
* @param $fileName bool|string optional for debug reporting
|
||||
* @param string $lines unsanitized input lines
|
||||
* @param BaseBlacklist $blacklist
|
||||
* @param bool|string $fileName optional for debug reporting
|
||||
* @return array of regexes
|
||||
*/
|
||||
static function buildSafeRegexes( $lines, BaseBlacklist $blacklist, $fileName=false ) {
|
||||
|
@ -112,7 +112,7 @@ class SpamRegexBatch {
|
|||
* Returns an array of invalid lines
|
||||
*
|
||||
* @param array $lines
|
||||
* @param $blacklist BaseBlacklist
|
||||
* @param BaseBlacklist $blacklist
|
||||
* @return array of input lines which produce invalid input, or empty array if no problems
|
||||
*/
|
||||
static function getBadLines( $lines, BaseBlacklist $blacklist ) {
|
||||
|
@ -146,9 +146,9 @@ class SpamRegexBatch {
|
|||
* Build a set of regular expressions from the given multiline input text,
|
||||
* with empty lines and comments stripped.
|
||||
*
|
||||
* @param $source string
|
||||
* @param $blacklist BaseBlacklist
|
||||
* @param $fileName bool|string optional, for reporting of bad files
|
||||
* @param string $source
|
||||
* @param BaseBlacklist $blacklist
|
||||
* @param bool|string $fileName optional, for reporting of bad files
|
||||
* @return array of regular expressions, potentially empty
|
||||
*/
|
||||
static function regexesFromText( $source, BaseBlacklist $blacklist, $fileName=false ) {
|
||||
|
@ -160,8 +160,8 @@ class SpamRegexBatch {
|
|||
* Build a set of regular expressions from a MediaWiki message.
|
||||
* Will be correctly empty if the message isn't present.
|
||||
*
|
||||
* @param $message string
|
||||
* @param $blacklist BaseBlacklist
|
||||
* @param string $message
|
||||
* @param BaseBlacklist $blacklist
|
||||
* @return array of regular expressions, potentially empty
|
||||
*/
|
||||
static function regexesFromMessage( $message, BaseBlacklist $blacklist ) {
|
||||
|
|
|
@ -57,6 +57,7 @@ class ApiSpamBlacklist extends ApiBase {
|
|||
|
||||
/**
|
||||
* @see ApiBase::getExamplesMessages()
|
||||
* @return array
|
||||
*/
|
||||
protected function getExamplesMessages() {
|
||||
return [
|
||||
|
|
|
@ -11,6 +11,9 @@ require_once 'SpamBlacklist_body.php';
|
|||
|
||||
/**
|
||||
* Find the latest revision of the article that does not contain spam and revert to it
|
||||
* @param Revision $rev
|
||||
* @param array $regexes
|
||||
* @param array $match
|
||||
*/
|
||||
function cleanupArticle( Revision $rev, $regexes, $match ) {
|
||||
$title = $rev->getTitle();
|
||||
|
|
|
@ -4,10 +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.MissingReturn" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
|
||||
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
|
||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
|
||||
</rule>
|
||||
|
|
Loading…
Reference in a new issue