Merge "upload: Simplify file extension extraction in UploadBase"
[lhc/web/wiklou.git] / includes / filerepo / ForeignDBRepo.php
index f49ef88..4b33138 100644 (file)
@@ -21,6 +21,9 @@
  * @ingroup FileRepo
  */
 
+use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * A foreign repository with an accessible MediaWiki database
  *
@@ -55,9 +58,9 @@ class ForeignDBRepo extends LocalRepo {
        protected $dbConn;
 
        /** @var callable */
-       protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ];
+       protected $fileFactory = [ ForeignDBFile::class, 'newFromTitle' ];
        /** @var callable */
-       protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ];
+       protected $fileFromRowFactory = [ ForeignDBFile::class, 'newFromRow' ];
 
        /**
         * @param array|null $info
@@ -129,16 +132,15 @@ class ForeignDBRepo extends LocalRepo {
        function getSharedCacheKey( /*...*/ ) {
                if ( $this->hasSharedCache() ) {
                        $args = func_get_args();
-                       array_unshift( $args, $this->dbName, $this->tablePrefix );
 
-                       return call_user_func_array( 'wfForeignMemcKey', $args );
+                       return wfForeignMemcKey( $this->dbName, $this->tablePrefix, ...$args );
                } else {
                        return false;
                }
        }
 
        protected function assertWritableRepo() {
-               throw new MWException( get_class( $this ) . ': write operations are not supported.' );
+               throw new MWException( static::class . ': write operations are not supported.' );
        }
 
        /**