Fix PhpStorm IDE warnings in ServiceWiring.php
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 29 Aug 2019 04:50:12 +0000 (21:50 -0700)
committerKrinkle <krinklemail@gmail.com>
Tue, 3 Sep 2019 23:03:23 +0000 (23:03 +0000)
Change-Id: Ic1352311908a08a19346ebbee5f5ce73db7633f3

includes/MovePage.php
includes/ServiceWiring.php
includes/page/MovePageFactory.php

index 4180e32..564c8f4 100644 (file)
@@ -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
        ) {
index d081629..b53011f 100644 (file)
@@ -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()
                );
index 26da151..2f3fac2 100644 (file)
@@ -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
        ) {