X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUpload.php;h=93e432b9512900a895140eb910b48e97a662d453;hb=062d935971a96b788953448fc2b150056a41924e;hp=a283b5a215341eb91a4fac9bf044d4a67c70598b;hpb=94ad2bf3801eba8767363e22c16212fa084f9a2d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index a283b5a215..93e432b951 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -1,9 +1,5 @@ * * This program is free software; you can redistribute it and/or modify @@ -71,7 +67,7 @@ class ApiUpload extends ApiBase { $this->checkPermissions( $user ); // Fetch the file (usually a no-op) - /** @var $status Status */ + /** @var Status $status */ $status = $this->mUpload->fetchFile(); if ( !$status->isGood() ) { $this->dieStatus( $status ); @@ -728,26 +724,26 @@ class ApiUpload extends ApiBase { */ protected function handleStashException( $e ) { switch ( get_class( $e ) ) { - case 'UploadStashFileNotFoundException': + case UploadStashFileNotFoundException::class: $wrap = 'apierror-stashedfilenotfound'; break; - case 'UploadStashBadPathException': + case UploadStashBadPathException::class: $wrap = 'apierror-stashpathinvalid'; break; - case 'UploadStashFileException': + case UploadStashFileException::class: $wrap = 'apierror-stashfilestorage'; break; - case 'UploadStashZeroLengthFileException': + case UploadStashZeroLengthFileException::class: $wrap = 'apierror-stashzerolength'; break; - case 'UploadStashNotLoggedInException': + case UploadStashNotLoggedInException::class: return StatusValue::newFatal( ApiMessage::create( [ 'apierror-mustbeloggedin', $this->msg( 'action-upload' ) ], 'stashnotloggedin' ) ); - case 'UploadStashWrongOwnerException': + case UploadStashWrongOwnerException::class: $wrap = 'apierror-stashwrongowner'; break; - case 'UploadStashNoSuchKeyException': + case UploadStashNoSuchKeyException::class: $wrap = 'apierror-stashnosuchfilekey'; break; default: @@ -772,7 +768,7 @@ class ApiUpload extends ApiBase { $this->mParams['text'] = $this->mParams['comment']; } - /** @var $file LocalFile */ + /** @var LocalFile $file */ $file = $this->mUpload->getLocalFile(); // For preferences mode, we want to watch if 'watchdefault' is set, @@ -829,7 +825,7 @@ class ApiUpload extends ApiBase { $result['result'] = 'Poll'; $result['stage'] = 'queued'; } else { - /** @var $status Status */ + /** @var Status $status */ $status = $this->mUpload->performUpload( $this->mParams['comment'], $this->mParams['text'], $watch, $this->getUser(), $this->mParams['tags'] );