mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-11 16:58:14 +00:00
Use namespaced classes
Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Ib30da35841aadb558709dbbe6e30be2241048c87
This commit is contained in:
parent
4a2238e460
commit
f3c4642fd5
|
@ -20,12 +20,13 @@
|
|||
*/
|
||||
namespace Popups;
|
||||
|
||||
use Config;
|
||||
use ExtensionRegistry;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\SpecialPage\SpecialPageFactory;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\User\Options\UserOptionsLookup;
|
||||
use MediaWiki\User\User;
|
||||
|
||||
/**
|
||||
* Popups Module
|
||||
|
@ -70,7 +71,7 @@ class PopupsContext {
|
|||
private const REFERENCE_PREVIEWS_ENABLED = 4;
|
||||
|
||||
/**
|
||||
* @var \Config
|
||||
* @var Config
|
||||
*/
|
||||
private $config;
|
||||
|
||||
|
@ -123,18 +124,18 @@ class PopupsContext {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \User $user User whose gadgets settings are being checked
|
||||
* @param User $user User whose gadgets settings are being checked
|
||||
* @return bool
|
||||
*/
|
||||
public function conflictsWithNavPopupsGadget( \User $user ) {
|
||||
public function conflictsWithNavPopupsGadget( User $user ) {
|
||||
return $this->gadgetsIntegration->conflictsWithNavPopupsGadget( $user );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \User $user User whose gadgets settings are being checked
|
||||
* @param User $user User whose gadgets settings are being checked
|
||||
* @return bool
|
||||
*/
|
||||
public function conflictsWithRefTooltipsGadget( \User $user ) {
|
||||
public function conflictsWithRefTooltipsGadget( User $user ) {
|
||||
return $this->gadgetsIntegration->conflictsWithRefTooltipsGadget( $user );
|
||||
}
|
||||
|
||||
|
@ -148,10 +149,10 @@ class PopupsContext {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \User $user User whose preferences are checked
|
||||
* @param User $user User whose preferences are checked
|
||||
* @return bool whether or not to show reference previews
|
||||
*/
|
||||
public function isReferencePreviewsEnabled( \User $user ) {
|
||||
public function isReferencePreviewsEnabled( User $user ) {
|
||||
if ( !$this->config->get( 'PopupsReferencePreviews' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -162,20 +163,20 @@ class PopupsContext {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \User $user User whose preferences are checked
|
||||
* @param User $user User whose preferences are checked
|
||||
* @return int
|
||||
*/
|
||||
public function getConfigBitmaskFromUser( \User $user ) {
|
||||
public function getConfigBitmaskFromUser( User $user ) {
|
||||
return ( $this->conflictsWithNavPopupsGadget( $user ) ? self::NAV_POPUPS_ENABLED : 0 ) |
|
||||
( $this->conflictsWithRefTooltipsGadget( $user ) ? self::REF_TOOLTIPS_ENABLED : 0 ) |
|
||||
( $this->isReferencePreviewsEnabled( $user ) ? self::REFERENCE_PREVIEWS_ENABLED : 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \User $user User whose preferences are checked
|
||||
* @param User $user User whose preferences are checked
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldSendModuleToUser( \User $user ) {
|
||||
public function shouldSendModuleToUser( User $user ) {
|
||||
if ( !$user->isNamed() ) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
*/
|
||||
namespace Popups;
|
||||
|
||||
use Config;
|
||||
use ExtensionRegistry;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Extension\Gadgets\GadgetRepo;
|
||||
use MediaWiki\User\User;
|
||||
|
||||
/**
|
||||
* Gadgets integration
|
||||
|
@ -80,10 +81,10 @@ class PopupsGadgetsIntegration {
|
|||
* Check if Popups conflicts with Nav Popups Gadget
|
||||
* If user enabled Nav Popups, Popups is unavailable
|
||||
*
|
||||
* @param \User $user User whose gadget settings are checked
|
||||
* @param User $user User whose gadget settings are checked
|
||||
* @return bool
|
||||
*/
|
||||
public function conflictsWithNavPopupsGadget( \User $user ) {
|
||||
public function conflictsWithNavPopupsGadget( User $user ) {
|
||||
if ( $this->isGadgetExtensionEnabled() ) {
|
||||
$gadgetsRepo = GadgetRepo::singleton();
|
||||
$match = array_search( $this->navPopupsGadgetName, $gadgetsRepo->getGadgetIds() );
|
||||
|
@ -103,10 +104,10 @@ class PopupsGadgetsIntegration {
|
|||
* Check if Popups conflicts with Ref Tooltips Gadget
|
||||
* If user enabled Ref Tooltip, Popups is unavailable
|
||||
*
|
||||
* @param \User $user User whose gadget settings are checked
|
||||
* @param User $user User whose gadget settings are checked
|
||||
* @return bool
|
||||
*/
|
||||
public function conflictsWithRefTooltipsGadget( \User $user ) {
|
||||
public function conflictsWithRefTooltipsGadget( User $user ) {
|
||||
if ( $this->isGadgetExtensionEnabled() ) {
|
||||
$gadgetsRepo = GadgetRepo::singleton();
|
||||
$match = array_search( $this->refTooltipsGadgetName, $gadgetsRepo->getGadgetIds() );
|
||||
|
|
|
@ -20,19 +20,19 @@
|
|||
*/
|
||||
namespace Popups;
|
||||
|
||||
use Config;
|
||||
use ExtensionRegistry;
|
||||
use MediaWiki\Auth\Hook\LocalUserCreatedHook;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Hook\BeforePageDisplayHook;
|
||||
use MediaWiki\Hook\MakeGlobalVariablesScriptHook;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Output\OutputPage;
|
||||
use MediaWiki\Preferences\Hook\GetPreferencesHook;
|
||||
use MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook;
|
||||
use MediaWiki\User\Hook\UserGetDefaultOptionsHook;
|
||||
use MediaWiki\User\Options\UserOptionsManager;
|
||||
use OutputPage;
|
||||
use MediaWiki\User\User;
|
||||
use Skin;
|
||||
use User;
|
||||
|
||||
/**
|
||||
* Hooks definitions for Popups extension
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
* @ingroup extensions
|
||||
*/
|
||||
|
||||
use MediaWiki\Config\GlobalVarConfig;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\User\Options\UserOptionsLookup;
|
||||
use MediaWiki\User\User;
|
||||
use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls;
|
||||
use Popups\PopupsContext;
|
||||
use Popups\PopupsGadgetsIntegration;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
* @ingroup extensions
|
||||
*/
|
||||
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\User\Options\UserOptionsLookup;
|
||||
use Popups\PopupsContext;
|
||||
use Popups\PopupsGadgetsIntegration;
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
* @ingroup extensions
|
||||
*/
|
||||
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Extension\Gadgets\Gadget;
|
||||
use MediaWiki\Extension\Gadgets\GadgetRepo;
|
||||
use MediaWiki\User\User;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Popups\PopupsGadgetsIntegration;
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
* @ingroup extensions
|
||||
*/
|
||||
|
||||
use MediaWiki\Config\MultiConfig;
|
||||
use MediaWiki\Output\OutputPage;
|
||||
use MediaWiki\User\Options\UserOptionsManager;
|
||||
use MediaWiki\User\User;
|
||||
use Popups\PopupsContext;
|
||||
use Popups\PopupsHooks;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
|
Loading…
Reference in a new issue