mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 13:46:48 +00:00
Fix various typos and documentation issues
Change-Id: I1e9d297f665282d251343598e102e1d342488965
This commit is contained in:
parent
b4ee0b6606
commit
9beeca3752
|
@ -11,7 +11,7 @@ class CentralDBManager {
|
|||
|
||||
/** @var LBFactory */
|
||||
private $loadBalancerFactory;
|
||||
/** @var string|null */
|
||||
/** @var string|false */
|
||||
private $dbName;
|
||||
/** @var bool */
|
||||
private $filterIsCentral;
|
||||
|
|
|
@ -200,9 +200,7 @@ class Throttle extends Consequence implements ConsequencesDisablerConsequence {
|
|||
break;
|
||||
default:
|
||||
// Should never happen
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new InvalidArgumentException( "Invalid throttle type $type." );
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
return "$type-$identifier";
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace MediaWiki\Extension\AbuseFilter;
|
||||
|
||||
use BadMethodCallException;
|
||||
use DeferredUpdates;
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
|
@ -185,7 +184,6 @@ class FilterRunner {
|
|||
*
|
||||
* @param bool $allowStash Whether we are allowed to check the cache to see if there's a cached
|
||||
* result of a previous execution for the same edit.
|
||||
* @throws BadMethodCallException If run() was already called on this instance
|
||||
* @return Status Good if no action has been taken, a fatal otherwise.
|
||||
*/
|
||||
public function run( $allowStash = true ): Status {
|
||||
|
|
|
@ -9,7 +9,7 @@ interface AbuseFilterComputeVariableHook {
|
|||
* Hook runner for the `AbuseFilter-computeVariable` hook
|
||||
*
|
||||
* Like AbuseFilter-interceptVariable but called if the requested method wasn't found.
|
||||
* Return true to indicate that the method is known to the hook and was computed successful.
|
||||
* Return false to indicate that the method is known to the hook and was computed successfully.
|
||||
*
|
||||
* @param string $method Method to generate the variable
|
||||
* @param VariableHolder $vars
|
||||
|
|
|
@ -63,7 +63,7 @@ class GlobalAbuseFilterPager extends AbuseFilterPager {
|
|||
|
||||
return $lang->commaList( $statuses );
|
||||
case 'af_hit_count':
|
||||
// If the rule is hidden, don't show it, even to priviledged local admins
|
||||
// If the rule is hidden, don't show it, even to privileged local admins
|
||||
if ( $row->af_hidden ) {
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ class FilterEvaluator {
|
|||
}
|
||||
|
||||
$offset = $this->evalNode( $offset );
|
||||
// @todo If $array has no elements we could already throw an outofbounds. We don'tan
|
||||
// @todo If $array has no elements we could already throw an outofbounds. We don't
|
||||
// know what the index is, though.
|
||||
|
||||
if ( $array->getType() !== AFPData::DUNDEFINED ) {
|
||||
|
@ -1111,7 +1111,7 @@ class FilterEvaluator {
|
|||
/**
|
||||
* Search for substrings in a string
|
||||
*
|
||||
* Use is_any to determine wether to use logic OR (true) or AND (false).
|
||||
* Use is_any to determine whether to use logic OR (true) or AND (false).
|
||||
*
|
||||
* Use normalize = true to make use of ccnorm and
|
||||
* normalize both sides of the search.
|
||||
|
|
|
@ -196,7 +196,7 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
|
|||
* An array of size 1: either the URL is like Special:AbuseLog/id where
|
||||
* the id is log identifier, in which case the details of the log except for
|
||||
* private bits (e.g. IP address) are shown, or Special:AbuseLog/hide for hiding entries,
|
||||
* or the URL is incomplete as in Special:AbuseLog/private (without speciying id),
|
||||
* or the URL is incomplete as in Special:AbuseLog/private (without specifying id),
|
||||
* in which case a warning is shown to the user
|
||||
*
|
||||
* An array of size 0 when URL is like Special:AbuseLog or an array of size
|
||||
|
|
|
@ -314,7 +314,7 @@ class RunVariableGenerator extends VariableGenerator {
|
|||
$this->vars->setVar( 'summary', $summary );
|
||||
$this->vars->setVar( 'old_wikitext', $oldtext );
|
||||
$this->vars->setVar( 'new_wikitext', $text );
|
||||
// TODO: set old_content and new_content vars, use them
|
||||
// TODO: set old_content_model and new_content_model vars, use them
|
||||
$this->addEditVars( $page, $this->user, true );
|
||||
}
|
||||
return $this->vars;
|
||||
|
|
|
@ -1205,6 +1205,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
|
||||
$origFilter = $this->loadFilterData( $filter );
|
||||
|
||||
/** @var MutableFilter $newFilter */
|
||||
$newFilter = $origFilter instanceof MutableFilter
|
||||
? clone $origFilter
|
||||
: MutableFilter::newFromParentFilter( $origFilter );
|
||||
|
|
Loading…
Reference in a new issue