From: Aaron Schulz Date: Fri, 18 Sep 2015 17:45:15 +0000 (-0700) Subject: Cleaned up getScopedFileLocks() return value X-Git-Tag: 1.31.0-rc.0~9957^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=5cea7769d3d0d6bd2e502af14be0afbf3730be59;p=lhc%2Fweb%2Fwiklou.git Cleaned up getScopedFileLocks() return value * 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 --- diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index ce0360f902..cd82ab1034 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -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 ); diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index d27d2c6850..6c6a90b375 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -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 ); } } diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index e4b07b85e1..2562f52d42 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -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 ) {