From b7fce1c2f4a7c1ab715464f91fd9b02a72e549e5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 28 Aug 2019 21:50:12 -0700 Subject: [PATCH] Fix PhpStorm IDE warnings in ServiceWiring.php Change-Id: Ic1352311908a08a19346ebbee5f5ce73db7633f3 --- includes/MovePage.php | 12 ++++++------ includes/ServiceWiring.php | 11 +++++------ includes/page/MovePageFactory.php | 9 +++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/includes/MovePage.php b/includes/MovePage.php index 4180e3293a..564c8f4d6c 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -25,7 +25,7 @@ use MediaWiki\Page\MovePageFactory; use MediaWiki\Permissions\PermissionManager; use MediaWiki\Revision\SlotRecord; use Wikimedia\Rdbms\IDatabase; -use Wikimedia\Rdbms\LoadBalancer; +use Wikimedia\Rdbms\ILoadBalancer; /** * Handles the backend logic of moving a page from one title @@ -51,7 +51,7 @@ class MovePage { protected $options; /** - * @var LoadBalancer + * @var ILoadBalancer */ protected $loadBalancer; @@ -61,7 +61,7 @@ class MovePage { protected $nsInfo; /** - * @var WatchedItemStore + * @var WatchedItemStoreInterface */ protected $watchedItems; @@ -81,7 +81,7 @@ class MovePage { * @param Title $oldTitle * @param Title $newTitle * @param ServiceOptions|null $options - * @param LoadBalancer|null $loadBalancer + * @param ILoadBalancer|null $loadBalancer * @param NamespaceInfo|null $nsInfo * @param WatchedItemStore|null $watchedItems * @param PermissionManager|null $permMgr @@ -90,9 +90,9 @@ class MovePage { Title $oldTitle, Title $newTitle, ServiceOptions $options = null, - LoadBalancer $loadBalancer = null, + ILoadBalancer $loadBalancer = null, NamespaceInfo $nsInfo = null, - WatchedItemStore $watchedItems = null, + WatchedItemStoreInterface $watchedItems = null, PermissionManager $permMgr = null, RepoGroup $repoGroup = null ) { diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index d081629611..b53011ff96 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -287,9 +287,9 @@ return [ 'LocalServerObjectCache' => function ( MediaWikiServices $services ) : BagOStuff { $config = $services->getMainConfig(); - $cacheId = \ObjectCache::detectLocalServerCache(); + $cacheId = ObjectCache::detectLocalServerCache(); - return \ObjectCache::newFromParams( $config->get( 'ObjectCaches' )[$cacheId] ); + return ObjectCache::newFromParams( $config->get( 'ObjectCaches' )[$cacheId] ); }, 'LockManagerGroupFactory' => function ( MediaWikiServices $services ) : LockManagerGroupFactory { @@ -318,7 +318,7 @@ return [ "Cache type \"$id\" is not present in \$wgObjectCaches." ); } - return \ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches' )[$id] ); + return ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches' )[$id] ); }, 'MainWANObjectCache' => function ( MediaWikiServices $services ) : WANObjectCache { @@ -338,7 +338,7 @@ return [ } $params['store'] = $mainConfig->get( 'ObjectCaches' )[$objectCacheId]; - return \ObjectCache::newWANCacheFromParams( $params ); + return ObjectCache::newWANCacheFromParams( $params ); }, 'MediaHandlerFactory' => function ( MediaWikiServices $services ) : MediaHandlerFactory { @@ -493,8 +493,7 @@ return [ // 'class' and 'preprocessorClass' $services->getMainConfig()->get( 'ParserConf' ), // Make sure to have defaults in case someone overrode ParserConf with something silly - [ 'class' => Parser::class, - 'preprocessorClass' => Parser::getDefaultPreprocessorClass() ], + [ 'class' => Parser::class, 'preprocessorClass' => Preprocessor_Hash::class ], // Plus a buch of actual config options $services->getMainConfig() ); diff --git a/includes/page/MovePageFactory.php b/includes/page/MovePageFactory.php index 26da151844..2f3fac2e7d 100644 --- a/includes/page/MovePageFactory.php +++ b/includes/page/MovePageFactory.php @@ -28,7 +28,8 @@ use NamespaceInfo; use RepoGroup; use Title; use WatchedItemStore; -use Wikimedia\Rdbms\LoadBalancer; +use WatchedItemStoreInterface; +use Wikimedia\Rdbms\ILoadBalancer; /** * @since 1.34 @@ -37,7 +38,7 @@ class MovePageFactory { /** @var ServiceOptions */ private $options; - /** @var LoadBalancer */ + /** @var ILoadBalancer */ private $loadBalancer; /** @var NamespaceInfo */ @@ -63,9 +64,9 @@ class MovePageFactory { public function __construct( ServiceOptions $options, - LoadBalancer $loadBalancer, + ILoadBalancer $loadBalancer, NamespaceInfo $nsInfo, - WatchedItemStore $watchedItems, + WatchedItemStoreInterface $watchedItems, PermissionManager $permMgr, RepoGroup $repoGroup ) { -- 2.20.1