Add @deprecated to Article::prepareTextForEdit()
[lhc/web/wiklou.git] / includes / filerepo / ForeignDBRepo.php
index f3a560b..7fb7a0e 100644 (file)
@@ -51,10 +51,13 @@ class ForeignDBRepo extends LocalRepo {
        /** @var bool */
        protected $hasSharedCache;
 
-       # Other stuff
+       /** @var IDatabase */
        protected $dbConn;
-       protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
-       protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
+
+       /** @var callable */
+       protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ];
+       /** @var callable */
+       protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ];
 
        /**
         * @param array|null $info
@@ -94,18 +97,19 @@ class ForeignDBRepo extends LocalRepo {
         * @return Closure
         */
        protected function getDBFactory() {
-               return function( $index ) {
-                       return DatabaseBase::factory( $this->dbType,
-                               array(
-                                       'host' => $this->dbServer,
-                                       'user' => $this->dbUser,
-                                       'password' => $this->dbPassword,
-                                       'dbname' => $this->dbName,
-                                       'flags' => $this->dbFlags,
-                                       'tablePrefix' => $this->tablePrefix,
-                                       'foreign' => true,
-                               )
-                       );
+               $type = $this->dbType;
+               $params = [
+                       'host' => $this->dbServer,
+                       'user' => $this->dbUser,
+                       'password' => $this->dbPassword,
+                       'dbname' => $this->dbName,
+                       'flags' => $this->dbFlags,
+                       'tablePrefix' => $this->tablePrefix,
+                       'foreign' => true,
+               ];
+
+               return function ( $index ) use ( $type, $params ) {
+                       return Database::factory( $type, $params );
                };
        }