Use namespaced classes

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

Change-Id: I3d7a1ffe167b69d3f4ce51d0c248c758e1cdd70c
This commit is contained in:
Umherirrender 2024-06-12 20:31:47 +02:00
parent a890a9a0d4
commit a51c944567
22 changed files with 33 additions and 24 deletions

View file

@ -3,6 +3,7 @@
namespace MediaWiki\Extension\Notifications;
use Language;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\Notifications\Formatters\EchoEventFormatter;
use MediaWiki\Extension\Notifications\Formatters\EchoFlyoutFormatter;
use MediaWiki\Extension\Notifications\Formatters\EchoModelFormatter;
@ -14,7 +15,6 @@ use MediaWiki\User\User;
use MediaWiki\User\UserIdentity;
use MediaWiki\Utils\MWTimestamp;
use MediaWiki\WikiMap\WikiMap;
use RequestContext;
/**
* Utility class that formats a notification in the format specified

View file

@ -5,9 +5,11 @@ namespace MediaWiki\Extension\Notifications;
use Article;
use IDBAccessObject;
use Language;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\Notifications\Hooks\HookRunner;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\MediaWikiServices;
use MediaWiki\Parser\ParserOutput;
use MediaWiki\Parser\Sanitizer;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\SlotRecord;
@ -15,8 +17,6 @@ use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserNameUtils;
use ParserOptions;
use ParserOutput;
use RequestContext;
use RuntimeException;
use TextContent;

View file

@ -5,6 +5,7 @@ namespace MediaWiki\Extension\Notifications;
use ApiMain;
use CentralAuthSessionProvider;
use Exception;
use MediaWiki\Context\RequestContext;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\Request\FauxRequest;
@ -15,7 +16,6 @@ use MediaWiki\User\User;
use MediaWiki\User\UserIdentity;
use MediaWiki\WikiMap\WikiMap;
use MWExceptionHandler;
use RequestContext;
class ForeignWikiRequest {

View file

@ -4,9 +4,9 @@ namespace MediaWiki\Extension\Notifications\Formatters;
use MediaWiki\Language\RawMessage;
use MediaWiki\MediaWikiServices;
use MediaWiki\Message\Message;
use MediaWiki\Parser\Sanitizer;
use MediaWiki\Revision\RevisionRecord;
use Message;
class EchoEditUserPagePresentationModel extends EchoEventPresentationModel {

View file

@ -4,8 +4,8 @@ namespace MediaWiki\Extension\Notifications\Formatters;
use Language;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Message\Message;
use MediaWiki\User\User;
use Message;
/**
* Abstract class for formatters that process multiple events.

View file

@ -5,8 +5,8 @@ namespace MediaWiki\Extension\Notifications\Formatters;
use Language;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Message\Message;
use MediaWiki\User\User;
use Message;
/**
* Abstract class that each "formatter" should implement.

View file

@ -8,13 +8,13 @@ use Language;
use MediaWiki\Extension\Notifications\Controller\NotificationController;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\MediaWikiServices;
use MediaWiki\Message\Message;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWiki\User\UserIdentity;
use MediaWiki\WikiMap\WikiMap;
use Message;
use MessageLocalizer;
use MessageSpecifier;
use Wikimedia\Timestamp\TimestampException;

View file

@ -6,10 +6,10 @@ use BadMethodCallException;
use Language;
use MediaWiki\Extension\Notifications\DiscussionParser;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Parser\Parser;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use Parser;
/**
* Component that represents a section of a page to be used from EchoEventPresentationModel subclass.

View file

@ -4,11 +4,8 @@ namespace MediaWiki\Extension\Notifications;
use ApiModuleManager;
use Content;
use EchoAttributeManager;
use EchoUserLocator;
use EmailNotification;
use ExtensionRegistry;
use HTMLCheckMatrix;
use Language;
use LogEntry;
use LogicException;
@ -30,22 +27,23 @@ use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Extension\Notifications\Model\Notification;
use MediaWiki\Extension\Notifications\Push\Api\ApiEchoPushSubscriptions;
use MediaWiki\Hook\AbortTalkPageEmailNotificationHook;
use MediaWiki\Hook\BeforePageDisplayHook;
use MediaWiki\Hook\EmailUserCompleteHook;
use MediaWiki\Hook\GetNewMessagesAlertHook;
use MediaWiki\Hook\LinksUpdateCompleteHook;
use MediaWiki\Hook\LoginFormValidErrorMessagesHook;
use MediaWiki\Hook\OutputPageCheckLastModifiedHook;
use MediaWiki\Hook\PreferencesGetIconHook;
use MediaWiki\Hook\RecentChange_saveHook;
use MediaWiki\Hook\SendWatchlistEmailNotificationHook;
use MediaWiki\Hook\SkinTemplateNavigation__UniversalHook;
use MediaWiki\Hook\SpecialMuteModifyFormFieldsHook;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HTMLForm\Field\HTMLCheckMatrix;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Output\Hook\BeforePageDisplayHook;
use MediaWiki\Output\Hook\OutputPageCheckLastModifiedHook;
use MediaWiki\Output\OutputPage;
use MediaWiki\Page\Hook\ArticleDeleteCompleteHook;
use MediaWiki\Page\Hook\ArticleUndeleteHook;
@ -116,7 +114,7 @@ class Hooks implements
private AuthManager $authManager;
private CentralIdLookup $centralIdLookup;
private Config $config;
private EchoAttributeManager $attributeManager;
private AttributeManager $attributeManager;
private HookContainer $hookContainer;
private Language $contentLanguage;
private LinkRenderer $linkRenderer;
@ -135,7 +133,7 @@ class Hooks implements
AuthManager $authManager,
CentralIdLookup $centralIdLookup,
Config $config,
EchoAttributeManager $attributeManager,
AttributeManager $attributeManager,
HookContainer $hookContainer,
Language $contentLanguage,
LinkRenderer $linkRenderer,
@ -816,7 +814,7 @@ class Hooks implements
$linkFromPageId = $linksUpdate->getTitle()->getArticleID();
// T318523: Don't send page-linked notifications for pages created by bot users.
$articleAuthor = EchoUserLocator::getArticleAuthorByArticleId( $title->getArticleID() );
$articleAuthor = UserLocator::getArticleAuthorByArticleId( $title->getArticleID() );
if ( $articleAuthor && $articleAuthor->isBot() ) {
continue;
}

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\Notifications;
use DatabaseUpdater;
use MediaWiki\Installer\DatabaseUpdater;
use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
class SchemaHooks implements LoadExtensionSchemaUpdatesHook {

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\Notifications\Special;
use IContextSource;
use LogicException;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\Notifications\DbFactory;
use MediaWiki\Extension\Notifications\Model\Notification;
use MediaWiki\Extension\Notifications\Services;

View file

@ -5,10 +5,10 @@ namespace MediaWiki\Extension\Notifications\Special;
use MediaWiki\Extension\Notifications\AttributeManager;
use MediaWiki\Extension\Notifications\Hooks as EchoHooks;
use MediaWiki\Html\Html;
use MediaWiki\HTMLForm\OOUIHTMLForm;
use MediaWiki\SpecialPage\UnlistedSpecialPage;
use MediaWiki\User\Options\UserOptionsManager;
use MediaWiki\User\User;
use OOUIHTMLForm;
class SpecialDisplayNotificationsConfiguration extends UnlistedSpecialPage {
/**

View file

@ -2,8 +2,8 @@
namespace MediaWiki\Extension\Notifications\Special;
use HTMLForm;
use MediaWiki\Extension\Notifications\NotifUser;
use MediaWiki\HTMLForm\HTMLForm;
use MediaWiki\SpecialPage\FormSpecialPage;
use MediaWiki\SpecialPage\SpecialPage;

View file

@ -2,6 +2,7 @@
use MediaWiki\Extension\Notifications\Mapper\NotificationMapper;
use MediaWiki\Extension\Notifications\NotifUser;
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group API

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group medium
* @group API

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group medium
* @group API

View file

@ -2,6 +2,7 @@
use MediaWiki\Extension\Notifications\Push\Utils;
use MediaWiki\Extension\Notifications\Services;
use MediaWiki\Tests\Api\ApiTestCase;
use MediaWiki\User\User;
/**

View file

@ -2,6 +2,7 @@
use MediaWiki\Extension\Notifications\Push\Utils;
use MediaWiki\Extension\Notifications\Services;
use MediaWiki\Tests\Api\ApiTestCase;
use MediaWiki\User\User;
/**

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group medium
* @group API

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\Context\DerivativeContext;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\Notifications\Mapper\NotificationMapper;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\User\User;

View file

@ -1,6 +1,7 @@
<?php
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group Echo

View file

@ -3,7 +3,6 @@
namespace MediaWiki\Extension\Notifications\Test;
use ContentHandler;
use EchoUserLocator;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Extension\Notifications\UserLocator;
use MediaWiki\Title\Title;
@ -130,7 +129,7 @@ class UserLocatorTest extends MediaWikiIntegrationTestCase {
->willReturn( User::newFromId( 123 ) );
$event->method( 'getType' )
->willReturn( 'page-linked' );
$this->assertEquals( [], EchoUserLocator::locateArticleCreator( $event ) );
$this->assertEquals( [], UserLocator::locateArticleCreator( $event ) );
$normalUser = $this->getTestUser()->getUser();
$normalUser->addToDatabase();
@ -145,7 +144,7 @@ class UserLocatorTest extends MediaWikiIntegrationTestCase {
->willReturn( 'page-linked' );
$this->assertEquals(
$normalUser->getUser()->getId(),
array_key_first( EchoUserLocator::locateArticleCreator( $event ) )
array_key_first( UserLocator::locateArticleCreator( $event ) )
);
}