Merge "Reset scoped session for upload jobs after deferred updates"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / PublishStashedFileJob.php
index caedf46..a6d2f70 100644 (file)
@@ -53,7 +53,7 @@ class PublishStashedFileJob extends Job {
                        UploadBase::setSessionStatus(
                                $user,
                                $this->params['filekey'],
-                               array( 'result' => 'Poll', 'stage' => 'publish', 'status' => Status::newGood() )
+                               [ 'result' => 'Poll', 'stage' => 'publish', 'status' => Status::newGood() ]
                        );
 
                        $upload = new UploadFromStash( $user );
@@ -67,11 +67,11 @@ class PublishStashedFileJob extends Job {
                        $verification = $upload->verifyUpload();
                        if ( $verification['status'] !== UploadBase::OK ) {
                                $status = Status::newFatal( 'verification-error' );
-                               $status->value = array( 'verification' => $verification );
+                               $status->value = [ 'verification' => $verification ];
                                UploadBase::setSessionStatus(
                                        $user,
                                        $this->params['filekey'],
-                                       array( 'result' => 'Failure', 'stage' => 'publish', 'status' => $status )
+                                       [ 'result' => 'Failure', 'stage' => 'publish', 'status' => $status ]
                                );
                                $this->setLastError( "Could not verify upload." );
 
@@ -84,13 +84,13 @@ class PublishStashedFileJob extends Job {
                                $this->params['text'],
                                $this->params['watch'],
                                $user,
-                               isset( $this->params['tags'] ) ? $this->params['tags'] : array()
+                               isset( $this->params['tags'] ) ? $this->params['tags'] : []
                        );
                        if ( !$status->isGood() ) {
                                UploadBase::setSessionStatus(
                                        $user,
                                        $this->params['filekey'],
-                                       array( 'result' => 'Failure', 'stage' => 'publish', 'status' => $status )
+                                       [ 'result' => 'Failure', 'stage' => 'publish', 'status' => $status ]
                                );
                                $this->setLastError( $status->getWikiText() );
 
@@ -108,23 +108,23 @@ class PublishStashedFileJob extends Job {
                        UploadBase::setSessionStatus(
                                $user,
                                $this->params['filekey'],
-                               array(
+                               [
                                        'result' => 'Success',
                                        'stage' => 'publish',
                                        'filename' => $upload->getLocalFile()->getName(),
                                        'imageinfo' => $imageInfo,
                                        'status' => Status::newGood()
-                               )
+                               ]
                        );
                } catch ( Exception $e ) {
                        UploadBase::setSessionStatus(
                                $user,
                                $this->params['filekey'],
-                               array(
+                               [
                                        'result' => 'Failure',
                                        'stage' => 'publish',
                                        'status' => Status::newFatal( 'api-error-publishfailed' )
-                               )
+                               ]
                        );
                        $this->setLastError( get_class( $e ) . ": " . $e->getMessage() );
                        // To prevent potential database referential integrity issues.
@@ -140,7 +140,7 @@ class PublishStashedFileJob extends Job {
        public function getDeduplicationInfo() {
                $info = parent::getDeduplicationInfo();
                if ( is_array( $info['params'] ) ) {
-                       $info['params'] = array( 'filekey' => $info['params']['filekey'] );
+                       $info['params'] = [ 'filekey' => $info['params']['filekey'] ];
                }
 
                return $info;