Merge "Add assertFileContains to MediaWikiTestCaseTrait"
[lhc/web/wiklou.git] / includes / Revision / RevisionStoreFactory.php
index 0475557..1de4d7f 100644 (file)
@@ -27,7 +27,7 @@ namespace MediaWiki\Revision;
 
 use ActorMigration;
 use CommentStore;
-use MediaWiki\Logger\Spi as LoggerSpi;
+use Psr\Log\LoggerInterface;
 use MediaWiki\Storage\BlobStoreFactory;
 use MediaWiki\Storage\NameTableStoreFactory;
 use WANObjectCache;
@@ -54,8 +54,8 @@ class RevisionStoreFactory {
        private $dbLoadBalancerFactory;
        /** @var WANObjectCache */
        private $cache;
-       /** @var LoggerSpi */
-       private $loggerProvider;
+       /** @var LoggerInterface */
+       private $logger;
 
        /** @var CommentStore */
        private $commentStore;
@@ -84,7 +84,7 @@ class RevisionStoreFactory {
         * @param CommentStore $commentStore
         * @param ActorMigration $actorMigration
         * @param int $migrationStage
-        * @param LoggerSpi $loggerProvider
+        * @param LoggerInterface $logger
         * @param bool $contentHandlerUseDB see {@link $wgContentHandlerUseDB}. Must be the same
         *        for all wikis in the cluster. Will go away after MCR migration.
         */
@@ -97,7 +97,7 @@ class RevisionStoreFactory {
                CommentStore $commentStore,
                ActorMigration $actorMigration,
                $migrationStage,
-               LoggerSpi $loggerProvider,
+               LoggerInterface $logger,
                $contentHandlerUseDB
        ) {
                Assert::parameterType( 'integer', $migrationStage, '$migrationStage' );
@@ -109,7 +109,7 @@ class RevisionStoreFactory {
                $this->commentStore = $commentStore;
                $this->actorMigration = $actorMigration;
                $this->mcrMigrationStage = $migrationStage;
-               $this->loggerProvider = $loggerProvider;
+               $this->logger = $logger;
                $this->contentHandlerUseDB = $contentHandlerUseDB;
        }
 
@@ -118,13 +118,14 @@ class RevisionStoreFactory {
         *
         * @param bool|string $dbDomain DB domain of the relevant wiki or false for the current one
         *
-        * @return RevisionStore for the given wikiId with all necessary services and a logger
+        * @return RevisionStore for the given wikiId with all necessary services
         */
        public function getRevisionStore( $dbDomain = false ) {
                Assert::parameterType( 'string|boolean', $dbDomain, '$dbDomain' );
 
                $store = new RevisionStore(
                        $this->dbLoadBalancerFactory->getMainLB( $dbDomain ),
+                       // @phan-suppress-next-line PhanAccessMethodInternal
                        $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
                        $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
                        $this->commentStore,
@@ -136,7 +137,7 @@ class RevisionStoreFactory {
                        $dbDomain
                );
 
-               $store->setLogger( $this->loggerProvider->getLogger( 'RevisionStore' ) );
+               $store->setLogger( $this->logger );
                $store->setContentHandlerUseDB( $this->contentHandlerUseDB );
 
                return $store;