Use executeOpHandlesInternal() in SwiftFileBackend
[lhc/web/wiklou.git] / includes / libs / filebackend / FileBackendStore.php
index bd2ce5d..039bd42 100644 (file)
@@ -21,6 +21,7 @@
  * @ingroup FileBackend
  * @author Aaron Schulz
  */
+use Wikimedia\Timestamp\ConvertibleTimestamp;
 
 /**
  * @brief Base class for all backends using particular storage medium.
@@ -359,7 +360,7 @@ abstract class FileBackendStore extends FileBackend {
                        $status->merge( $this->doConcatenate( $params ) );
                        $sec = microtime( true ) - $start_time;
                        if ( !$status->isOK() ) {
-                               $this->logger->error( get_class( $this ) . "-{$this->name}" .
+                               $this->logger->error( static::class . "-{$this->name}" .
                                        " failed to concatenate " . count( $params['srcs'] ) . " file(s) [$sec sec]" );
                        }
                }
@@ -729,7 +730,7 @@ abstract class FileBackendStore extends FileBackend {
        /**
         * @see FileBackendStore::getFileXAttributes()
         * @param array $params
-        * @return bool|string
+        * @return array[][]
         */
        protected function doGetFileXAttributes( array $params ) {
                return [ 'headers' => [], 'metadata' => [] ]; // not supported
@@ -1122,7 +1123,7 @@ abstract class FileBackendStore extends FileBackend {
                                $subStatus->success[$i] = false;
                                ++$subStatus->failCount;
                        }
-                       $this->logger->error( get_class( $this ) . "-{$this->name} " .
+                       $this->logger->error( static::class . "-{$this->name} " .
                                " stat failure; aborted operations: " . FormatJson::encode( $ops ) );
                }
 
@@ -1199,21 +1200,20 @@ abstract class FileBackendStore extends FileBackend {
         * to the order in which the handles where given.
         *
         * @param FileBackendStoreOpHandle[] $fileOpHandles
-        *
-        * @throws FileBackendError
         * @return StatusValue[] Map of StatusValue objects
+        * @throws FileBackendError
         */
        final public function executeOpHandlesInternal( array $fileOpHandles ) {
                $ps = $this->scopedProfileSection( __METHOD__ . "-{$this->name}" );
 
                foreach ( $fileOpHandles as $fileOpHandle ) {
                        if ( !( $fileOpHandle instanceof FileBackendStoreOpHandle ) ) {
-                               throw new InvalidArgumentException( "Got a non-FileBackendStoreOpHandle object." );
+                               throw new InvalidArgumentException( "Expected FileBackendStoreOpHandle object." );
                        } elseif ( $fileOpHandle->backend->getName() !== $this->getName() ) {
-                               throw new InvalidArgumentException(
-                                       "Got a FileBackendStoreOpHandle for the wrong backend." );
+                               throw new InvalidArgumentException( "Expected handle for this file backend." );
                        }
                }
+
                $res = $this->doExecuteOpHandlesInternal( $fileOpHandles );
                foreach ( $fileOpHandles as $fileOpHandle ) {
                        $fileOpHandle->closeResources();