diff --git a/includes/AFComputedVariable.php b/includes/AFComputedVariable.php index 1ae799571..286baec2b 100644 --- a/includes/AFComputedVariable.php +++ b/includes/AFComputedVariable.php @@ -5,8 +5,21 @@ use MediaWiki\MediaWikiServices; use MediaWiki\Logger\LoggerFactory; class AFComputedVariable { - public $mMethod, $mParameters; + /** + * @var string The method used to compute the variable + */ + public $mMethod; + /** + * @var array Parameters to be used with the specified method + */ + public $mParameters; + /** + * @var array Cache containing User objects already constructed + */ public static $userCache = []; + /** + * @var array Cache containing Page objects already constructed + */ public static $articleCache = []; /** @@ -140,7 +153,7 @@ class AFComputedVariable { /** * @param AbuseFilterVariableHolder $vars - * @return AFPData|array|int|mixed|null|string + * @return AFPData * @throws MWException * @throws AFPException */ diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 16805775b..d2b40da2f 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -13,7 +13,13 @@ use Wikimedia\Rdbms\IDatabase; * logging actions, etc. */ class AbuseFilter { + /** + * @var int How long to keep profiling data in cache (in seconds) + */ public static $statsStoragePeriod = 86400; + /** + * @var bool Whether the condition limit is enabled + */ public static $condLimitEnabled = true; /** @@ -25,10 +31,15 @@ class AbuseFilter { /** @var string The prefix to use for global filters */ const GLOBAL_FILTER_PREFIX = 'global-'; + /** + * @var int The amount of conditions currently used + */ public static $condCount = 0; - /** @var array Map of (action ID => string[]) */ - // FIXME: avoid global state here + /* + * @var array Map of (action ID => string[]) + * @fixme avoid global state here + */ public static $tagsToSet = []; public static $history_mappings = [ diff --git a/includes/Views/AbuseFilterView.php b/includes/Views/AbuseFilterView.php index 67ffdb811..bc5f2e6a8 100644 --- a/includes/Views/AbuseFilterView.php +++ b/includes/Views/AbuseFilterView.php @@ -3,7 +3,26 @@ use Wikimedia\Rdbms\IDatabase; abstract class AbuseFilterView extends ContextSource { - public $mFilter, $mHistoryID, $mSubmit, $mPage, $mParams; + /** + * @var string The ID of the current filter + */ + public $mFilter; + /** + * @var string The history ID of the current filter + */ + public $mHistoryID; + /** + * @var bool Whether the form was submitted + */ + public $mSubmit; + /** + * @var SpecialAbuseFilter The related special page object + */ + public $mPage; + /** + * @var array The parameters of the current request + */ + public $mParams; /** * @var \MediaWiki\Linker\LinkRenderer diff --git a/includes/Views/AbuseFilterViewDiff.php b/includes/Views/AbuseFilterViewDiff.php index 86480a8a8..d136c85a0 100644 --- a/includes/Views/AbuseFilterViewDiff.php +++ b/includes/Views/AbuseFilterViewDiff.php @@ -1,9 +1,21 @@ ']', ]; + /** + * @var string One of the D* const from this class + */ public $type; + /** + * @var mixed|null|AFPData[] The actual data contained in this object + */ public $data; /** diff --git a/includes/parser/AFPToken.php b/includes/parser/AFPToken.php index 897f5ded4..c261685fe 100644 --- a/includes/parser/AFPToken.php +++ b/includes/parser/AFPToken.php @@ -48,8 +48,17 @@ class AFPToken { const TCOMMA = 'T_COMMA'; const TSTATEMENTSEPARATOR = 'T_STATEMENT_SEPARATOR'; + /** + * @var string One of the T* constant from this class + */ public $type; + /** + * @var mixed|null The actual value of the token + */ public $value; + /** + * @var int The code offset where this token is found + */ public $pos; /** diff --git a/includes/parser/AbuseFilterParser.php b/includes/parser/AbuseFilterParser.php index 6677a61c8..697615430 100644 --- a/includes/parser/AbuseFilterParser.php +++ b/includes/parser/AbuseFilterParser.php @@ -5,16 +5,31 @@ use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; class AbuseFilterParser { - public $mTokens, $mPos, $mShortCircuit, $mAllowShort; - /** @var AFPToken The current token */ + /** + * @var array Contains the AFPTokens for the code being parsed + */ + public $mTokens; + /** + * @var int The position of the current token + */ + public $mPos; + /** + * @var bool Are we inside a short circuit evaluation? + */ + public $mShortCircuit; + /** + * @var bool Are we allowed to use short-circuit evaluation? + */ + public $mAllowShort; + /** + * @var AFPToken The current token + */ public $mCur; - /** * @var AbuseFilterVariableHolder */ public $mVars; - // length,lcase,ucase,ccnorm,rmdoubles,specialratio,rmspecials,norm,count,get_matches public static $mFunctions = [ 'lcase' => 'funcLc', 'ucase' => 'funcUc', diff --git a/includes/special/SpecialAbuseFilter.php b/includes/special/SpecialAbuseFilter.php index ccd2f8eed..897c7b26a 100644 --- a/includes/special/SpecialAbuseFilter.php +++ b/includes/special/SpecialAbuseFilter.php @@ -1,7 +1,14 @@