Cleaned up getScopedFileLocks() return value
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Sep 2015 17:45:15 +0000 (10:45 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Sep 2015 17:58:11 +0000 (17:58 +0000)
* Just return the ScopedLock itself without wrappig it in an array.
  This also makes getScopedLocksForOps() actually return the correct
  type according to the docs

Change-Id: Ic2d01d56c3fcb22af3adb5e5d4d1586d62316552

includes/filebackend/FileBackend.php
includes/filebackend/FileBackendMultiWrite.php
includes/filebackend/FileBackendStore.php

index ce0360f..cd82ab1 100644 (file)
@@ -1302,7 +1302,7 @@ abstract class FileBackend {
         *
         * @param array $ops List of file operations to FileBackend::doOperations()
         * @param Status $status Status to update on lock/unlock
-        * @return array List of ScopedFileLocks or null values
+        * @return ScopedLock|null
         * @since 1.20
         */
        abstract public function getScopedLocksForOps( array $ops, Status $status );
index d27d2c6..6c6a90b 100644 (file)
@@ -40,9 +40,7 @@
  * @since 1.19
  */
 class FileBackendMultiWrite extends FileBackend {
-       /** @var array Prioritized list of FileBackendStore objects.
-        * array of (backend index => backends)
-        */
+       /** @var FileBackendStore[] Prioritized list of FileBackendStore objects */
        protected $backends = array();
 
        /** @var int Index of master backend */
@@ -688,6 +686,6 @@ class FileBackendMultiWrite extends FileBackend {
                );
 
                // Actually acquire the locks
-               return array( $this->getScopedFileLocks( $pbPaths, 'mixed', $status ) );
+               return $this->getScopedFileLocks( $pbPaths, 'mixed', $status );
        }
 }
index e4b07b8..2562f52 100644 (file)
@@ -1058,7 +1058,7 @@ abstract class FileBackendStore extends FileBackend {
        public function getScopedLocksForOps( array $ops, Status $status ) {
                $paths = $this->getPathsToLockForOpsInternal( $this->getOperationsInternal( $ops ) );
 
-               return array( $this->getScopedFileLocks( $paths, 'mixed', $status ) );
+               return $this->getScopedFileLocks( $paths, 'mixed', $status );
        }
 
        final protected function doOperationsInternal( array $ops, array $opts ) {