jenkins-bot has submitted this change and it was merged.

Change subject: Fixed various FileBackendDBRepoWrapper errors found in IDE
......................................................................


Fixed various FileBackendDBRepoWrapper errors found in IDE

Change-Id: I8bf5a1a01ecaae24ffb53eb05896d3d5fc200abf
---
M includes/filerepo/FileBackendDBRepoWrapper.php
1 file changed, 7 insertions(+), 8 deletions(-)

Approvals:
  Gilles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/filerepo/FileBackendDBRepoWrapper.php 
b/includes/filerepo/FileBackendDBRepoWrapper.php
index 0401d0c..c83e5b1 100644
--- a/includes/filerepo/FileBackendDBRepoWrapper.php
+++ b/includes/filerepo/FileBackendDBRepoWrapper.php
@@ -46,7 +46,7 @@
        protected $dbHandleFunc;
        /** @var ProcessCacheLRU */
        protected $resolvedPathCache;
-       /** @var Array Map of (index => DBConnRef) */
+       /** @var DBConnRef[] */
        protected $dbs;
 
        public function __construct( array $config ) {
@@ -95,7 +95,6 @@
         */
        public function getBackendPaths( array $paths, $latest = true ) {
                $db = $this->getDB( $latest ? DB_MASTER : DB_SLAVE );
-               $origBasePath = $this->backend->getContainerStoragePath( 
"{$this->repoName}-original" );
 
                // @TODO: batching
                $resolved = array();
@@ -105,7 +104,7 @@
                                continue;
                        }
 
-                       list( , $container, $rel ) = 
FileBackend::splitStoragePath( $path );
+                       list( , $container ) = FileBackend::splitStoragePath( 
$path );
 
                        if ( $container === "{$this->repoName}-public" ) {
                                $name = basename( $path );
@@ -258,7 +257,7 @@
        }
 
        public function getScopedLocksForOps( array $ops, Status $status ) {
-               return $this->backend->getScopedFileLocks( $ops, $status );
+               return $this->backend->getScopedLocksForOps( $ops, $status );
        }
 
        /**
@@ -271,7 +270,7 @@
         */
        public function getPathForSHA1( $sha1 ) {
                if ( strlen( $sha1 ) < 3 ) {
-                       throw new MWException( "Invalid file SHA-1." );
+                       throw new InvalidArgumentException( "Invalid file 
SHA-1." );
                }
                return $this->backend->getContainerStoragePath( 
"{$this->repoName}-original" ) .
                        "/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
@@ -284,11 +283,11 @@
         * @return DBConnRef
         */
        protected function getDB( $index ) {
-               if ( !isset( $this->db[$index] ) ) {
+               if ( !isset( $this->dbs[$index] ) ) {
                        $func = $this->dbHandleFunc;
-                       $this->db[$index] = $func( $index );
+                       $this->dbs[$index] = $func( $index );
                }
-               return $this->db[$index];
+               return $this->dbs[$index];
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/226121
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8bf5a1a01ecaae24ffb53eb05896d3d5fc200abf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Gilles <gdu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to