Use namespaced classes

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

Change-Id: I4cf7903b9700e6366bdf349f99ffd4a04da0c087
This commit is contained in:
Umherirrender 2024-10-20 09:27:34 +02:00
parent cecbd594d1
commit 7038c68f13
26 changed files with 35 additions and 25 deletions

View file

@ -9,6 +9,7 @@ use MediaWiki\Extension\Math\MathWikibaseConnector;
use MediaWiki\Extension\Math\Render\RendererFactory; use MediaWiki\Extension\Math\Render\RendererFactory;
use MediaWiki\Logger\LoggerFactory; use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use MediaWiki\Registration\ExtensionRegistry;
use Wikibase\Client\WikibaseClient; use Wikibase\Client\WikibaseClient;
use Wikibase\Lib\Formatters\SnakFormatter; use Wikibase\Lib\Formatters\SnakFormatter;

View file

@ -19,6 +19,7 @@
*/ */
use MediaWiki\Extension\Math\MathRenderer; use MediaWiki\Extension\Math\MathRenderer;
use MediaWiki\Maintenance\Maintenance;
require_once __DIR__ . '/../../../maintenance/Maintenance.php'; require_once __DIR__ . '/../../../maintenance/Maintenance.php';

View file

@ -18,6 +18,8 @@
* @ingroup Maintenance * @ingroup Maintenance
*/ */
use MediaWiki\Maintenance\Maintenance;
require_once __DIR__ . '/../../../maintenance/Maintenance.php'; require_once __DIR__ . '/../../../maintenance/Maintenance.php';
class MathGenerateSql extends Maintenance { class MathGenerateSql extends Maintenance {

View file

@ -19,6 +19,8 @@
* @ingroup Maintenance * @ingroup Maintenance
*/ */
use MediaWiki\Maintenance\Maintenance;
require_once __DIR__ . '/../../../maintenance/Maintenance.php'; require_once __DIR__ . '/../../../maintenance/Maintenance.php';
// phpcs:disable MediaWiki.Files.ClassMatchesFilename.NotMatch // phpcs:disable MediaWiki.Files.ClassMatchesFilename.NotMatch

View file

@ -14,8 +14,8 @@ use MediaWiki\Hook\ParserOptionsRegisterHook;
use MediaWiki\HookContainer\HookContainer; use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Logger\LoggerFactory; use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Parser\Parser; use MediaWiki\Parser\Parser;
use MediaWiki\Parser\ParserOptions;
use MediaWiki\User\Options\UserOptionsLookup; use MediaWiki\User\Options\UserOptionsLookup;
use ParserOptions;
/** /**
* Hook handler for Parser hooks * Hook handler for Parser hooks

View file

@ -10,11 +10,11 @@ namespace MediaWiki\Extension\Math;
// phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName // phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
use ExtensionRegistry;
use Maintenance;
use MediaWiki\Config\ConfigException; use MediaWiki\Config\ConfigException;
use MediaWiki\Context\RequestContext; use MediaWiki\Context\RequestContext;
use MediaWiki\Hook\MaintenanceRefreshLinksInitHook; use MediaWiki\Hook\MaintenanceRefreshLinksInitHook;
use MediaWiki\Maintenance\Maintenance;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Settings\SettingsBuilder; use MediaWiki\Settings\SettingsBuilder;
use MediaWiki\SpecialPage\Hook\SpecialPage_initListHook; use MediaWiki\SpecialPage\Hook\SpecialPage_initListHook;
use MediaWiki\User\Options\UserOptionsManager; use MediaWiki\User\Options\UserOptionsManager;

View file

@ -6,7 +6,7 @@ use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\Math\MathRestbaseInterface; use MediaWiki\Extension\Math\MathRestbaseInterface;
use MediaWiki\Http\HttpRequestFactory; use MediaWiki\Http\HttpRequestFactory;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use WANObjectCache; use Wikimedia\ObjectCache\WANObjectCache;
class InputCheckFactory { class InputCheckFactory {

View file

@ -8,7 +8,7 @@ use MediaWiki\Extension\Math\MathRenderer;
use MediaWiki\Extension\Math\WikiTexVC\TexVC; use MediaWiki\Extension\Math\WikiTexVC\TexVC;
use MediaWiki\HookContainer\HookContainer; use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Message\Message; use MediaWiki\Message\Message;
use WANObjectCache; use Wikimedia\ObjectCache\WANObjectCache;
class LocalChecker extends BaseChecker { class LocalChecker extends BaseChecker {

View file

@ -6,7 +6,7 @@ use MediaWiki\Http\HttpRequestFactory;
use MediaWiki\Message\Message; use MediaWiki\Message\Message;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use RuntimeException; use RuntimeException;
use WANObjectCache; use Wikimedia\ObjectCache\WANObjectCache;
class MathoidChecker extends BaseChecker { class MathoidChecker extends BaseChecker {

View file

@ -2,9 +2,9 @@
namespace MediaWiki\Extension\Math; namespace MediaWiki\Extension\Math;
use ExtensionRegistry;
use MediaWiki\Config\ServiceOptions; use MediaWiki\Config\ServiceOptions;
use MediaWiki\Message\Message; use MediaWiki\Message\Message;
use MediaWiki\Registration\ExtensionRegistry;
use Wikibase\Client\WikibaseClient; use Wikibase\Client\WikibaseClient;
class MathConfig { class MathConfig {

View file

@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface;
use StatusValue; use StatusValue;
use stdClass; use stdClass;
use Throwable; use Throwable;
use XmlTypeCheck; use Wikimedia\Mime\XmlTypeCheck;
/** /**
* Converts LaTeX to MathML using the mathoid-server * Converts LaTeX to MathML using the mathoid-server

View file

@ -20,7 +20,7 @@ use MediaWiki\Parser\Parser;
use MediaWiki\Parser\Sanitizer; use MediaWiki\Parser\Sanitizer;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use StringUtils; use StringUtils;
use WANObjectCache; use Wikimedia\ObjectCache\WANObjectCache;
/** /**
* Abstract base class with static methods for rendering the <math> tags using * Abstract base class with static methods for rendering the <math> tags using

View file

@ -13,6 +13,7 @@ use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use stdClass; use stdClass;
use Wikimedia\Http\MultiHttpClient;
class MathRestbaseInterface { class MathRestbaseInterface {
/** @var string|false */ /** @var string|false */
@ -53,9 +54,9 @@ class MathRestbaseInterface {
* Bundles several requests for fetching MathML. * Bundles several requests for fetching MathML.
* Does not send requests, if the input TeX is invalid. * Does not send requests, if the input TeX is invalid.
* @param MathRestbaseInterface[] $rbis * @param MathRestbaseInterface[] $rbis
* @param \MultiHttpClient $multiHttpClient * @param MultiHttpClient $multiHttpClient
*/ */
private static function batchGetMathML( array $rbis, \MultiHttpClient $multiHttpClient ) { private static function batchGetMathML( array $rbis, MultiHttpClient $multiHttpClient ) {
$requests = []; $requests = [];
$skips = []; $skips = [];
$i = 0; $i = 0;

View file

@ -13,7 +13,7 @@ use MediaWiki\Extension\Math\MathRenderer;
use MediaWiki\Extension\Math\MathSource; use MediaWiki\Extension\Math\MathSource;
use MediaWiki\User\Options\UserOptionsLookup; use MediaWiki\User\Options\UserOptionsLookup;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use WANObjectCache; use Wikimedia\ObjectCache\WANObjectCache;
class RendererFactory { class RendererFactory {

View file

@ -2,10 +2,10 @@
namespace MediaWiki\Extension\Math; namespace MediaWiki\Extension\Math;
use ExtensionRegistry;
use MediaWiki\Extension\Math\Render\RendererFactory; use MediaWiki\Extension\Math\Render\RendererFactory;
use MediaWiki\Extension\Math\Widget\MathTestInputForm; use MediaWiki\Extension\Math\Widget\MathTestInputForm;
use MediaWiki\Logger\LoggerFactory; use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\SpecialPage\SpecialPage;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;

View file

@ -12,7 +12,7 @@ use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Message\Message; use MediaWiki\Message\Message;
use MediaWiki\Tests\Unit\MockServiceDependenciesTrait; use MediaWiki\Tests\Unit\MockServiceDependenciesTrait;
use MediaWikiIntegrationTestCase; use MediaWikiIntegrationTestCase;
use WANObjectCache; use Wikimedia\ObjectCache\WANObjectCache;
/** /**
* @method InputCheckFactory newServiceInstance(string $serviceClass, array $parameterOverrides) * @method InputCheckFactory newServiceInstance(string $serviceClass, array $parameterOverrides)

View file

@ -2,10 +2,10 @@
namespace MediaWiki\Extension\Math\InputCheck; namespace MediaWiki\Extension\Math\InputCheck;
use HashBagOStuff;
use MediaWiki\Message\Message; use MediaWiki\Message\Message;
use MediaWikiIntegrationTestCase; use MediaWikiIntegrationTestCase;
use WANObjectCache; use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\ObjectCache\WANObjectCache;
/** /**
* @group Math * @group Math

View file

@ -2,14 +2,14 @@
namespace MediaWiki\Extension\Math\InputCheck; namespace MediaWiki\Extension\Math\InputCheck;
use HashBagOStuff;
use MediaWiki\Extension\Math\Math; use MediaWiki\Extension\Math\Math;
use MediaWiki\Extension\Math\MathMathML; use MediaWiki\Extension\Math\MathMathML;
use MediaWiki\Http\HttpRequestFactory; use MediaWiki\Http\HttpRequestFactory;
use MediaWikiIntegrationTestCase; use MediaWikiIntegrationTestCase;
use MockHttpTrait; use MockHttpTrait;
use RuntimeException; use RuntimeException;
use WANObjectCache; use Wikimedia\ObjectCache\HashBagOStuff;
use Wikimedia\ObjectCache\WANObjectCache;
class MathoidCheckerTest extends MediaWikiIntegrationTestCase { class MathoidCheckerTest extends MediaWikiIntegrationTestCase {
use MockHttpTrait; use MockHttpTrait;

View file

@ -3,8 +3,8 @@
namespace MediaWiki\Extension\Math\Tests; namespace MediaWiki\Extension\Math\Tests;
use MockHttpTrait; use MockHttpTrait;
use MultiHttpClient;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Wikimedia\Http\MultiHttpClient;
trait MathMockHttpTrait { trait MathMockHttpTrait {
use MockHttpTrait; use MockHttpTrait;

View file

@ -4,6 +4,7 @@ use MediaWiki\Extension\Math\InvalidTeXException;
use MediaWiki\Extension\Math\MathRestbaseException; use MediaWiki\Extension\Math\MathRestbaseException;
use MediaWiki\Extension\Math\MathRestbaseInterface; use MediaWiki\Extension\Math\MathRestbaseInterface;
use MediaWiki\Extension\Math\Tests\MathMockHttpTrait; use MediaWiki\Extension\Math\Tests\MathMockHttpTrait;
use Wikimedia\Http\MultiHttpClient;
/** /**
* Test the interface to access Restbase paths * Test the interface to access Restbase paths

View file

@ -7,8 +7,8 @@ use MediaWiki\Extension\Math\MathConfig;
use MediaWiki\Extension\Math\MathRenderer; use MediaWiki\Extension\Math\MathRenderer;
use MediaWiki\Extension\Math\Render\RendererFactory; use MediaWiki\Extension\Math\Render\RendererFactory;
use MediaWiki\Page\PageReferenceValue; use MediaWiki\Page\PageReferenceValue;
use MediaWiki\Parser\ParserOptions;
use MediaWikiIntegrationTestCase; use MediaWikiIntegrationTestCase;
use ParserOptions;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
/** /**

View file

@ -1,8 +1,8 @@
<?php <?php
namespace MediaWiki\Extension\Math\Tests; namespace MediaWiki\Extension\Math\Tests;
use ExtensionRegistry;
use MediaWiki\Extension\Math\Hooks; use MediaWiki\Extension\Math\Hooks;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Settings\Config\ArrayConfigBuilder; use MediaWiki\Settings\Config\ArrayConfigBuilder;
use MediaWiki\Settings\Config\PhpIniSink; use MediaWiki\Settings\Config\PhpIniSink;
use MediaWiki\Settings\SettingsBuilder; use MediaWiki\Settings\SettingsBuilder;

View file

@ -2,9 +2,9 @@
namespace MediaWiki\Extension\Math\Tests; namespace MediaWiki\Extension\Math\Tests;
use ExtensionRegistry;
use MediaWiki\Config\ServiceOptions; use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\Math\MathConfig; use MediaWiki\Extension\Math\MathConfig;
use MediaWiki\Registration\ExtensionRegistry;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** /**

View file

@ -1,12 +1,12 @@
<?php <?php
namespace MediaWiki\Extension\Math\Tests; namespace MediaWiki\Extension\Math\Tests;
use ExtensionRegistry;
use MediaWiki\Config\HashConfig; use MediaWiki\Config\HashConfig;
use MediaWiki\Config\ServiceOptions; use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\Math\Math; use MediaWiki\Extension\Math\Math;
use MediaWiki\Extension\Math\MathConfig; use MediaWiki\Extension\Math\MathConfig;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWikiUnitTestCase; use MediaWikiUnitTestCase;
/** /**

View file

@ -3,13 +3,13 @@
namespace MediaWiki\Extension\Math\Tests; namespace MediaWiki\Extension\Math\Tests;
use DataValues\StringValue; use DataValues\StringValue;
use ExtensionRegistry;
use Language;
use MediaWiki\Config\ServiceOptions; use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\Math\MathFormatter; use MediaWiki\Extension\Math\MathFormatter;
use MediaWiki\Extension\Math\MathWikibaseConnector; use MediaWiki\Extension\Math\MathWikibaseConnector;
use MediaWiki\Language\Language;
use MediaWiki\Languages\LanguageFactory; use MediaWiki\Languages\LanguageFactory;
use MediaWiki\Languages\LanguageNameUtils; use MediaWiki\Languages\LanguageNameUtils;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Site\Site; use MediaWiki\Site\Site;
use MediaWikiUnitTestCase; use MediaWikiUnitTestCase;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;

View file

@ -4,8 +4,10 @@
*/ */
require_once __DIR__ . '/../../../maintenance/Maintenance.php'; require_once __DIR__ . '/../../../maintenance/Maintenance.php';
use MediaWiki\Content\TextContent;
use MediaWiki\Extension\Math\MathConfig; use MediaWiki\Extension\Math\MathConfig;
use MediaWiki\Extension\Math\MathMathMLCli; use MediaWiki\Extension\Math\MathMathMLCli;
use MediaWiki\Maintenance\Maintenance;
use MediaWiki\Parser\Parser; use MediaWiki\Parser\Parser;
use MediaWiki\Parser\Sanitizer; use MediaWiki\Parser\Sanitizer;
use MediaWiki\Title\Title; use MediaWiki\Title\Title;