Use namespaced classes

Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: If80031678a474157e4cc78a3d3621dab53aded67
This commit is contained in:
Umherirrender 2024-10-19 21:55:40 +02:00
parent 8c0255acc3
commit 57ecef75c5
70 changed files with 127 additions and 120 deletions

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter;
use IBufferingStatsdDataFactory;
use MediaWiki\Auth\AbstractPreAuthenticationProvider;
use MediaWiki\Auth\AuthenticationRequest;
use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory;
@ -10,6 +9,7 @@ use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\User\User;
use MediaWiki\User\UserFactory;
use StatusValue;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
/**
* AuthenticationProvider used to filter account creations. This runs after normal preauth providers

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter;
use ExtensionRegistry;
use InvalidArgumentException;
use ManualLogEntry;
use MediaWiki\CheckUser\Hooks;
@ -11,6 +10,7 @@ use MediaWiki\Deferred\DeferredUpdates;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserIdentityValue;

View file

@ -18,8 +18,8 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiMain;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiMain;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog;
use Wikimedia\ParamValidator\ParamValidator;

View file

@ -2,12 +2,12 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiMain;
use ApiResult;
use LogEventsList;
use LogicException;
use LogPage;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiMain;
use MediaWiki\Api\ApiResult;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory;

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiMain;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiMain;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException;
use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory;

View file

@ -2,9 +2,9 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiMain;
use ApiResult;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiMain;
use MediaWiki\Api\ApiResult;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory;
use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory;

View file

@ -18,9 +18,9 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiQuery;
use ApiQueryBase;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiQuery;
use MediaWiki\Api\ApiQueryBase;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\Filter\Flags;
use MediaWiki\Extension\AbuseFilter\FilterUtils;

View file

@ -18,10 +18,10 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiQuery;
use ApiQueryBase;
use InvalidArgumentException;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiQuery;
use MediaWiki\Api\ApiQueryBase;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\AbuseLoggerFactory;
use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException;

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\Api;
use ApiBase;
use ApiMain;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiMain;
use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore;
use MediaWiki\ParamValidator\TypeDef\UserDef;
use Wikimedia\ParamValidator\ParamValidator;

View file

@ -2,11 +2,11 @@
namespace MediaWiki\Extension\AbuseFilter;
use BagOStuff;
use ManualLogEntry;
use MediaWiki\Title\TitleValue;
use MediaWiki\User\UserIdentity;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\BagOStuff;
/**
* Class responsible for storing and retrieving blockautopromote status

View file

@ -19,7 +19,6 @@
*/
namespace MediaWiki\Extension\AbuseFilter;
use ExtensionRegistry;
use LogPage;
use ManualLogEntry;
use MediaWiki\CheckUser\Hooks as CUHooks;
@ -27,6 +26,7 @@ use MediaWiki\Extension\AbuseFilter\Variables\UnsetVariableException;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Message\Message;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Status\Status;
use MediaWiki\Title\Title;
use MediaWiki\User\User;

View file

@ -19,10 +19,7 @@
*/
namespace MediaWiki\Extension\AbuseFilter;
use ApiRawMessage;
use BagOStuff;
use DBAccessObjectUtils;
use IDBAccessObject;
use MediaWiki\Api\ApiRawMessage;
use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Content\JsonContent;
use MediaWiki\Json\FormatJson;
@ -38,6 +35,9 @@ use MediaWiki\User\UserIdentity;
use MediaWiki\Utils\UrlUtils;
use RecentChange;
use StatusValue;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Rdbms\DBAccessObjectUtils;
use Wikimedia\Rdbms\IDBAccessObject;
/**
* Hold and update information about blocked external domains

View file

@ -5,7 +5,7 @@ namespace MediaWiki\Extension\AbuseFilter\ChangeTags;
use MediaWiki\ChangeTags\ChangeTagsStore;
use MediaWiki\Extension\AbuseFilter\CentralDBManager;
use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException;
use WANObjectCache;
use Wikimedia\ObjectCache\WANObjectCache;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IReadableDatabase;
use Wikimedia\Rdbms\LBFactory;

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Consequences\Consequence;
use BagOStuff;
use InvalidArgumentException;
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequenceNotPrecheckedException;
use MediaWiki\Extension\AbuseFilter\Consequences\Parameters;
@ -11,6 +10,7 @@ use MediaWiki\User\UserEditTracker;
use MediaWiki\User\UserFactory;
use Psr\Log\LoggerInterface;
use Wikimedia\IPUtils;
use Wikimedia\ObjectCache\BagOStuff;
/**
* Consequence that delays executing other actions until certain conditions are met

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Consequences;
use BagOStuff;
use MediaWiki\Block\BlockUserFactory;
use MediaWiki\Block\DatabaseBlockStore;
use MediaWiki\Config\ServiceOptions;
@ -26,6 +25,7 @@ use MediaWiki\User\UserGroupManager;
use MediaWiki\User\UserIdentityUtils;
use MessageLocalizer;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\BagOStuff;
class ConsequencesFactory {
public const SERVICE_NAME = 'AbuseFilterConsequencesFactory';

View file

@ -2,13 +2,13 @@
namespace MediaWiki\Extension\AbuseFilter;
use BagOStuff;
use IBufferingStatsdDataFactory;
use InvalidArgumentException;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Linker\LinkTarget;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
/**
* Wrapper around cache for storing and retrieving data from edit stash

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter;
use BagOStuff;
use Wikimedia\ObjectCache\BagOStuff;
/**
* Helper class for EmergencyWatcher. Wrapper around cache which tracks hits of recently

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter;
use IDBAccessObject;
use MediaWiki\Extension\AbuseFilter\Filter\ClosestFilterVersionNotFoundException;
use MediaWiki\Extension\AbuseFilter\Filter\ExistingFilter;
use MediaWiki\Extension\AbuseFilter\Filter\FilterNotFoundException;
@ -13,7 +12,8 @@ use MediaWiki\Extension\AbuseFilter\Filter\LastEditInfo;
use MediaWiki\Extension\AbuseFilter\Filter\Specs;
use RuntimeException;
use stdClass;
use WANObjectCache;
use Wikimedia\ObjectCache\WANObjectCache;
use Wikimedia\Rdbms\IDBAccessObject;
use Wikimedia\Rdbms\ILoadBalancer;
use Wikimedia\Rdbms\IReadableDatabase;
use Wikimedia\Rdbms\SelectQueryBuilder;

View file

@ -2,11 +2,11 @@
namespace MediaWiki\Extension\AbuseFilter;
use BagOStuff;
use IBufferingStatsdDataFactory;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Title\Title;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
use Wikimedia\WRStats\LocalEntityKey;
use Wikimedia\WRStats\WRStatsFactory;

View file

@ -2,8 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter;
use BagOStuff;
use IBufferingStatsdDataFactory;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger;
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesExecutorFactory;
@ -16,8 +14,10 @@ use MediaWiki\Extension\AbuseFilter\Watcher\EmergencyWatcher;
use MediaWiki\Extension\AbuseFilter\Watcher\UpdateHitCountWatcher;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use NullStatsdDataFactory;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
use Wikimedia\Stats\NullStatsdDataFactory;
class FilterRunnerFactory {
public const SERVICE_NAME = 'AbuseFilterFilterRunnerFactory';

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\Hooks;
use Content;
use MediaWiki\Content\Content;
interface AbuseFilterContentToStringHook {
/**

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\Hooks;
use Content;
use MediaWiki\Content\Content;
use MediaWiki\Extension\AbuseFilter\VariableGenerator\RCVariableGenerator;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\HookContainer\HookContainer;

View file

@ -2,12 +2,12 @@
namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers;
use BagOStuff;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore;
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry;
use MediaWiki\User\Hook\GetAutoPromoteGroupsHook;
use MediaWiki\User\UserIdentity;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\ObjectCache\HashBagOStuff;
class AutoPromoteGroupsHandler implements GetAutoPromoteGroupsHook {

View file

@ -2,11 +2,11 @@
namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers;
use Content;
use ExtensionRegistry;
use MediaWiki\Content\Content;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\ConfirmEdit\Hooks;
use MediaWiki\Hook\EditFilterMergedContentHook;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Status\Status;
use MediaWiki\User\User;

View file

@ -2,9 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers;
use ApiMessage;
use Content;
use IBufferingStatsdDataFactory;
use MediaWiki\Api\ApiMessage;
use MediaWiki\Content\Content;
use MediaWiki\Context\IContextSource;
use MediaWiki\Deferred\DeferredUpdates;
use MediaWiki\Extension\AbuseFilter\BlockedDomainFilter;
@ -24,6 +23,7 @@ use MediaWiki\Storage\Hook\ParserOutputStashForEditHook;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use UploadBase;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
use WikiPage;
/**

View file

@ -10,11 +10,11 @@
namespace MediaWiki\Extension\AbuseFilter\Parser;
use IBufferingStatsdDataFactory;
use InvalidArgumentException;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException;
use Psr\Log\LoggerInterface;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
/**
* A parser that transforms the text of the filter into a parse tree.

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\Parser;
use BagOStuff;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException;
use Wikimedia\ObjectCache\BagOStuff;
/**
* Tokenizer for AbuseFilter rules.

View file

@ -2,11 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\Parser;
use BagOStuff;
use Exception;
use IBufferingStatsdDataFactory;
use InvalidArgumentException;
use Language;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\ConditionLimitException;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\ExceptionBase;
@ -15,10 +12,13 @@ use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleWarning;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Language\Language;
use MediaWiki\Parser\Sanitizer;
use Psr\Log\LoggerInterface;
use Wikimedia\Equivset\Equivset;
use Wikimedia\IPUtils;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
/**
* This class evaluates an AST generated by the filter parser.

View file

@ -2,14 +2,14 @@
namespace MediaWiki\Extension\AbuseFilter\Parser;
use BagOStuff;
use IBufferingStatsdDataFactory;
use Language;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Language\Language;
use Psr\Log\LoggerInterface;
use Wikimedia\Equivset\Equivset;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
class RuleCheckerFactory {
public const SERVICE_NAME = 'AbuseFilterRuleCheckerFactory';

View file

@ -44,6 +44,7 @@ use MediaWiki\Extension\AbuseFilter\Watcher\EmergencyWatcher;
use MediaWiki\Extension\AbuseFilter\Watcher\UpdateHitCountWatcher;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\WikiMap\WikiMap;
use Wikimedia\Equivset\Equivset;

View file

@ -20,14 +20,14 @@
namespace MediaWiki\Extension\AbuseFilter\Special;
use ErrorPageError;
use IDBAccessObject;
use MediaWiki\Extension\AbuseFilter\BlockedDomainStorage;
use MediaWiki\Html\Html;
use MediaWiki\HTMLForm\HTMLForm;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Title\TitleValue;
use PermissionsError;
use WANObjectCache;
use Wikimedia\ObjectCache\WANObjectCache;
use Wikimedia\Rdbms\IDBAccessObject;
/**
* List and manage blocked external domains

View file

@ -3,7 +3,6 @@
namespace MediaWiki\Extension\AbuseFilter\Special;
use DifferenceEngine;
use ExtensionRegistry;
use InvalidArgumentException;
use ManualLogEntry;
use MediaWiki\Cache\LinkBatchFactory;
@ -31,6 +30,7 @@ use MediaWiki\Linker\Linker;
use MediaWiki\MediaWikiServices;
use MediaWiki\Permissions\Authority;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Status\Status;

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter;
use Language;
use MediaWiki\Extension\AbuseFilter\Filter\AbstractFilter;
use MediaWiki\Language\Language;
use MediaWiki\Language\RawMessage;
use MediaWiki\Message\Message;
use MessageLocalizer;

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter;
use Content;
use MediaWiki\Content\Content;
use MediaWiki\Content\TextContent;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Permissions\Authority;

View file

@ -10,10 +10,10 @@ use MediaWiki\Page\WikiPageFactory;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserFactory;
use MimeAnalyzer;
use MWFileProps;
use RecentChange;
use RepoGroup;
use Wikimedia\Mime\MimeAnalyzer;
/**
* This class contains the logic used to create variable holders used to

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\VariableGenerator;
use Content;
use LogicException;
use MediaWiki\Content\Content;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Extension\AbuseFilter\TextExtractor;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
@ -14,10 +14,10 @@ use MediaWiki\Revision\SlotRecord;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserFactory;
use MimeAnalyzer;
use MWFileProps;
use UploadBase;
use Wikimedia\Assert\PreconditionException;
use Wikimedia\Mime\MimeAnalyzer;
use WikiPage;
/**

View file

@ -9,9 +9,9 @@ use MediaWiki\Page\WikiPageFactory;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserFactory;
use MimeAnalyzer;
use RecentChange;
use RepoGroup;
use Wikimedia\Mime\MimeAnalyzer;
class VariableGeneratorFactory {
public const SERVICE_NAME = 'AbuseFilterVariableGeneratorFactory';

View file

@ -2,14 +2,16 @@
namespace MediaWiki\Extension\AbuseFilter\Variables;
use ContentHandler;
use Language;
use MediaWiki\Content\ContentHandler;
use MediaWiki\Content\TextContent;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Extension\AbuseFilter\Parser\AFPData;
use MediaWiki\Extension\AbuseFilter\TextExtractor;
use MediaWiki\ExternalLinks\ExternalLinksLookup;
use MediaWiki\ExternalLinks\LinkFilter;
use MediaWiki\Language\Language;
use MediaWiki\Parser\ParserFactory;
use MediaWiki\Parser\ParserOptions;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Permissions\RestrictionStore;
use MediaWiki\Revision\RevisionLookup;
@ -24,16 +26,14 @@ use MediaWiki\User\UserEditTracker;
use MediaWiki\User\UserGroupManager;
use MediaWiki\User\UserIdentity;
use MediaWiki\User\UserIdentityUtils;
use ParserFactory;
use ParserOptions;
use Psr\Log\LoggerInterface;
use stdClass;
use StringUtils;
use UnexpectedValueException;
use WANObjectCache;
use Wikimedia\Diff\Diff;
use Wikimedia\Diff\UnifiedDiffFormatter;
use Wikimedia\IPUtils;
use Wikimedia\ObjectCache\WANObjectCache;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\LBFactory;
use Wikimedia\Rdbms\SelectQueryBuilder;

View file

@ -3,7 +3,6 @@
namespace MediaWiki\Extension\AbuseFilter\View;
use HtmlArmor;
use IDBAccessObject;
use LogicException;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
@ -28,6 +27,7 @@ use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Xml\Xml;
use OOUI;
use UnexpectedValueException;
use Wikimedia\Rdbms\IDBAccessObject;
use Wikimedia\Rdbms\IExpression;
use Wikimedia\Rdbms\LBFactory;
use Wikimedia\Rdbms\LikeValue;

View file

@ -10,9 +10,9 @@ if ( $IP === false ) {
require_once "$IP/maintenance/Maintenance.php";
// @codeCoverageIgnoreEnd
use LoggedUpdateMaintenance;
use ManualLogEntry;
use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseFilter;
use MediaWiki\Maintenance\LoggedUpdateMaintenance;
use MediaWiki\User\UserIdentityValue;
use Wikimedia\Rdbms\IExpression;
use Wikimedia\Rdbms\LikeValue;

View file

@ -8,7 +8,7 @@
namespace MediaWiki\Extension\AbuseFilter\Maintenance;
use LoggedUpdateMaintenance;
use MediaWiki\Maintenance\LoggedUpdateMaintenance;
use MediaWiki\MediaWikiServices;
use stdClass;
use Wikimedia\Rdbms\IDatabase;

View file

@ -10,7 +10,7 @@ if ( $IP === false ) {
require_once "$IP/maintenance/Maintenance.php";
// @codeCoverageIgnoreEnd
use Maintenance;
use MediaWiki\Maintenance\Maintenance;
use MediaWiki\Utils\MWTimestamp;
class PurgeOldLogIPData extends Maintenance {

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\AbuseFilter\Maintenance;
use Maintenance;
use MediaWiki\MainConfigNames;
use MediaWiki\Maintenance\Maintenance;
use Wikimedia\Rdbms\IExpression;
use Wikimedia\Rdbms\LikeValue;

View file

@ -3,12 +3,12 @@
namespace MediaWiki\Extension\AbuseFilter\Maintenance;
use ExternalStoreAccess;
use LoggedUpdateMaintenance;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore;
use MediaWiki\Json\FormatJson;
use MediaWiki\Maintenance\LoggedUpdateMaintenance;
use MediaWiki\MediaWikiServices;
use MediaWiki\Title\Title;
use UnexpectedValueException;

View file

@ -1,7 +1,10 @@
<?php
use MediaWiki\Block\BlockUser;
use MediaWiki\Content\Content;
use MediaWiki\Content\ContentHandler;
use MediaWiki\Content\JsonContent;
use MediaWiki\Content\WikitextContent;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\Filter\Flags;
@ -17,6 +20,7 @@ use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\WikiMap\WikiMap;
use Psr\Log\LoggerInterface;
use Wikimedia\Rdbms\IDBAccessObject;
use Wikimedia\Rdbms\SelectQueryBuilder;
use Wikimedia\Timestamp\ConvertibleTimestamp;

View file

@ -5,6 +5,7 @@ use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\PageReferenceValue;
use MediaWiki\User\User;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* This trait can be used to create accounts in integration tests.

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Integration;
use ExtensionRegistry;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Tests\ExtensionJsonTestBase;
/**

View file

@ -3,10 +3,11 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Integration;
use AbuseFilterCreateAccountTestTrait;
use ApiUsageException;
use Content;
use Generator;
use MediaWiki\Api\ApiUsageException;
use MediaWiki\Content\Content;
use MediaWiki\Content\JsonContent;
use MediaWiki\Content\WikitextContent;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\AbuseLogger;
use MediaWiki\Extension\AbuseFilter\AbuseLoggerFactory;
@ -28,8 +29,7 @@ use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Tests\Api\ApiTestCase;
use MediaWiki\Utils\MWTimestamp;
use NullStatsdDataFactory;
use WikitextContent;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* @group Database

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Integration;
use Content;
use MediaWiki\Content\Content;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\AbuseFilter\BlockedDomainFilter;
use MediaWiki\Extension\AbuseFilter\BlockedDomainStorage;
@ -19,7 +19,7 @@ use MediaWiki\Message\Message;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Status\Status;
use MediaWiki\Title\Title;
use NullStatsdDataFactory;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* @covers \MediaWiki\Extension\AbuseFilter\Hooks\Handlers\FilteredActionsHandler

View file

@ -2,6 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Integration\Hooks;
use MediaWiki\Content\Content;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\AbuseFilter\Consequences\Parameters;
use MediaWiki\Extension\AbuseFilter\Hooks\Handlers\ConfirmEditHandler;
@ -33,7 +34,7 @@ class ConfirmEditHandlerTest extends MediaWikiIntegrationTestCase {
$context->setTitle( $title );
$confirmEditHandler->onEditFilterMergedContent(
$context,
$this->createMock( \Content::class ),
$this->createMock( Content::class ),
$status,
'',
$this->createMock( User::class ),
@ -48,7 +49,7 @@ class ConfirmEditHandlerTest extends MediaWikiIntegrationTestCase {
$captchaConsequence->execute();
$confirmEditHandler->onEditFilterMergedContent(
$context,
$this->createMock( \Content::class ),
$this->createMock( Content::class ),
$status,
'',
$this->createMock( User::class ),

View file

@ -22,14 +22,14 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Integration\Parser;
use EmptyBagOStuff;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator;
use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWikiIntegrationTestCase;
use NullStatsdDataFactory;
use Wikimedia\Equivset\Equivset;
use Wikimedia\ObjectCache\EmptyBagOStuff;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* Tests that require Equivset, separated from the parser unit tests.

View file

@ -2,11 +2,11 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Integration;
use ExtensionRegistry;
use Generator;
use MediaWiki\CheckUser\Logging\TemporaryAccountLogger;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\ProtectedVarsAccessLogger;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWikiIntegrationTestCase;
/**

View file

@ -2,13 +2,13 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use BagOStuff;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore;
use MediaWiki\Extension\AbuseFilter\FilterUser;
use MediaWiki\User\UserIdentityValue;
use MediaWikiUnitTestCase;
use Psr\Log\NullLogger;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\ObjectCache\HashBagOStuff;
/**
* @covers \MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Consequences\Consequence;
use BagOStuff;
use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Throttle;
use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Warn;
use MediaWiki\Extension\AbuseFilter\Consequences\Parameters;
@ -11,6 +10,7 @@ use MediaWiki\User\UserEditTracker;
use MediaWiki\User\UserFactory;
use MediaWikiUnitTestCase;
use Psr\Log\NullLogger;
use Wikimedia\ObjectCache\BagOStuff;
/**
* Test for priorities of builtin ConsequencesDisablerConsequence classes

View file

@ -2,9 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Consequences\Consequence;
use BagOStuff;
use Generator;
use HashBagOStuff;
use InvalidArgumentException;
use MediaWiki\Extension\AbuseFilter\ActionSpecifier;
use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Throttle;
@ -20,6 +18,8 @@ use MediaWiki\User\UserIdentityValue;
use MediaWikiUnitTestCase;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\NullLogger;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\TestingAccessWrapper;
/**

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Consequences;
use HashBagOStuff;
use MediaWiki\Block\BlockUserFactory;
use MediaWiki\Block\DatabaseBlockStore;
use MediaWiki\Config\ServiceOptions;
@ -20,6 +19,7 @@ use MediaWiki\User\UserIdentityUtils;
use MediaWikiUnitTestCase;
use MessageLocalizer;
use Psr\Log\NullLogger;
use Wikimedia\ObjectCache\HashBagOStuff;
/**
* @group Test

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\EditStashCache;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer;
@ -10,8 +9,9 @@ use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Title\TitleValue;
use MediaWikiUnitTestCase;
use NullStatsdDataFactory;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* @covers \MediaWiki\Extension\AbuseFilter\EditStashCache

View file

@ -2,9 +2,9 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\EmergencyCache;
use MediaWikiUnitTestCase;
use Wikimedia\ObjectCache\HashBagOStuff;
/**
* @covers \MediaWiki\Extension\AbuseFilter\EmergencyCache

View file

@ -4,7 +4,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use AbuseFilterRowsAndFiltersTestTrait;
use Generator;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\CentralDBManager;
use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException;
use MediaWiki\Extension\AbuseFilter\Filter\ClosestFilterVersionNotFoundException;
@ -19,7 +18,8 @@ use MediaWiki\Extension\AbuseFilter\Filter\Specs;
use MediaWiki\Extension\AbuseFilter\FilterLookup;
use MediaWikiUnitTestCase;
use stdClass;
use WANObjectCache;
use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\ObjectCache\WANObjectCache;
use Wikimedia\Rdbms\FakeResultWrapper;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\ILoadBalancer;

View file

@ -2,8 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use HashBagOStuff;
use IBufferingStatsdDataFactory;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\AbuseFilter\FilterProfiler;
use MediaWiki\Title\Title;
@ -11,6 +9,8 @@ use MediaWikiUnitTestCase;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use TestLogger;
use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
use Wikimedia\WRStats\BagOStuffStatsStore;
use Wikimedia\WRStats\WRStatsFactory;

View file

@ -2,8 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use HashBagOStuff;
use IBufferingStatsdDataFactory;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\AbuseFilter\AbuseLoggerFactory;
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger;
@ -24,6 +22,8 @@ use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWikiUnitTestCase;
use Psr\Log\NullLogger;
use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\Stats\IBufferingStatsdDataFactory;
/**
* @group Test

View file

@ -2,12 +2,12 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Hooks;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore;
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry;
use MediaWiki\Extension\AbuseFilter\Hooks\Handlers\AutoPromoteGroupsHandler;
use MediaWiki\User\UserIdentityValue;
use MediaWikiUnitTestCase;
use Wikimedia\ObjectCache\HashBagOStuff;
/**
* @covers \MediaWiki\Extension\AbuseFilter\Hooks\Handlers\AutoPromoteGroupsHandler

View file

@ -22,8 +22,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser;
use EmptyBagOStuff;
use Language;
use LanguageEn;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
@ -31,11 +29,13 @@ use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException;
use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator;
use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Language\Language;
use MediaWikiUnitTestCase;
use NullStatsdDataFactory;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Wikimedia\Equivset\Equivset;
use Wikimedia\ObjectCache\EmptyBagOStuff;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* Helper for parser-related tests

View file

@ -2,16 +2,16 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser;
use BagOStuff;
use Language;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator;
use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Language\Language;
use MediaWikiUnitTestCase;
use NullStatsdDataFactory;
use Psr\Log\NullLogger;
use Wikimedia\Equivset\Equivset;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* @group Test

View file

@ -22,15 +22,15 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser;
use EmptyBagOStuff;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterTokenizer;
use MediaWiki\Extension\AbuseFilter\Parser\AFPTreeParser;
use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException;
use MediaWiki\Extension\AbuseFilter\Parser\SyntaxChecker;
use NullStatsdDataFactory;
use Psr\Log\NullLogger;
use Wikimedia\ObjectCache\EmptyBagOStuff;
use Wikimedia\Stats\NullStatsdDataFactory;
/**
* @group Test

View file

@ -22,8 +22,8 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser;
use HashBagOStuff;
use MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterTokenizer;
use Wikimedia\ObjectCache\HashBagOStuff;
/**
* @group Test

View file

@ -3,10 +3,10 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use Generator;
use Language;
use MediaWiki\Extension\AbuseFilter\Filter\AbstractFilter;
use MediaWiki\Extension\AbuseFilter\Filter\MutableFilter;
use MediaWiki\Extension\AbuseFilter\SpecsFormatter;
use MediaWiki\Language\Language;
use MediaWiki\Message\Message;
use MediaWikiUnitTestCase;
use MessageLocalizer;

View file

@ -2,10 +2,11 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use Content;
use DummyNonTextContent;
use Generator;
use MediaWiki\Content\Content;
use MediaWiki\Content\TextContent;
use MediaWiki\Content\WikitextContent;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
use MediaWiki\Extension\AbuseFilter\TextExtractor;
use MediaWiki\Page\PageIdentityValue;
@ -15,7 +16,6 @@ use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\User\UserIdentity;
use MediaWikiUnitTestCase;
use WikitextContent;
/**
* @group Test

View file

@ -11,9 +11,9 @@ use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserFactory;
use MediaWikiUnitTestCase;
use MimeAnalyzer;
use RecentChange;
use RepoGroup;
use Wikimedia\Mime\MimeAnalyzer;
/**
* @group Test

View file

@ -3,7 +3,6 @@
namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
use Generator;
use Language;
use LogicException;
use MediaWiki\Block\SystemBlock;
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
@ -12,6 +11,8 @@ use MediaWiki\Extension\AbuseFilter\TextExtractor;
use MediaWiki\Extension\AbuseFilter\Variables\LazyLoadedVariable;
use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer;
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Language\Language;
use MediaWiki\Parser\ParserFactory;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Permissions\RestrictionStore;
use MediaWiki\Request\WebRequest;
@ -25,10 +26,9 @@ use MediaWiki\User\UserGroupManager;
use MediaWiki\User\UserIdentityUtils;
use MediaWiki\User\UserIdentityValue;
use MediaWikiUnitTestCase;
use ParserFactory;
use Psr\Log\NullLogger;
use UnexpectedValueException;
use WANObjectCache;
use Wikimedia\ObjectCache\WANObjectCache;
use Wikimedia\Rdbms\LBFactory;
/**