diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2021-09-04 00:25:13 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2021-09-03 23:14:28 +0000 |
commit | a7bb7cc5c5d3f9edeb500272469241fefbe59a92 (patch) | |
tree | eab8b34e5d2c76087c8a4a417e3ee04d84962c80 /includes/api/ApiUpload.php | |
parent | c9e8d7e49dfcbd04ca2f59ca8928f0995856b70a (diff) | |
download | mediawikicore-a7bb7cc5c5d3f9edeb500272469241fefbe59a92.tar.gz mediawikicore-a7bb7cc5c5d3f9edeb500272469241fefbe59a92.zip |
Remove unreachable code after exception/die/exit
Change-Id: Ia81903fb2a8157625fbe63115097eccc1161b5db
Diffstat (limited to 'includes/api/ApiUpload.php')
-rw-r--r-- | includes/api/ApiUpload.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 82792c6717cf..d0976ecd5d01 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -648,31 +648,30 @@ class ApiUpload extends ApiBase { // Recoverable errors case UploadBase::MIN_LENGTH_PARTNAME: $this->dieRecoverableError( [ 'filename-tooshort' ], 'filename' ); - break; + // dieRecoverableError prevents continuation case UploadBase::ILLEGAL_FILENAME: $this->dieRecoverableError( [ ApiMessage::create( 'illegal-filename', null, [ 'filename' => $verification['filtered'] ] ) ], 'filename' ); - break; + // dieRecoverableError prevents continuation case UploadBase::FILENAME_TOO_LONG: $this->dieRecoverableError( [ 'filename-toolong' ], 'filename' ); - break; + // dieRecoverableError prevents continuation case UploadBase::FILETYPE_MISSING: $this->dieRecoverableError( [ 'filetype-missing' ], 'filename' ); - break; + // dieRecoverableError prevents continuation case UploadBase::WINDOWS_NONASCII_FILENAME: $this->dieRecoverableError( [ 'windows-nonascii-filename' ], 'filename' ); - break; // Unrecoverable errors case UploadBase::EMPTY_FILE: $this->dieWithError( 'empty-file' ); - break; + // dieWithError prevents continuation case UploadBase::FILE_TOO_LARGE: $this->dieWithError( 'file-too-large' ); - break; + // dieWithError prevents continuation case UploadBase::FILETYPE_BADTYPE: $extradata = [ @@ -700,7 +699,7 @@ class ApiUpload extends ApiBase { } $this->dieWithError( $msg, 'filetype-banned', $extradata ); - break; + // dieWithError prevents continuation case UploadBase::VERIFICATION_ERROR: $msg = ApiMessage::create( $verification['details'], 'verification-error' ); @@ -713,16 +712,15 @@ class ApiUpload extends ApiBase { $msg->setApiData( $msg->getApiData() + [ 'details' => $details ] ); // @phan-suppress-next-line PhanTypeMismatchArgument $this->dieWithError( $msg ); - break; + // dieWithError prevents continuation case UploadBase::HOOK_ABORTED: $msg = $verification['error'] === '' ? 'hookaborted' : $verification['error']; $this->dieWithError( $msg, 'hookaborted', [ 'details' => $verification['error'] ] ); - break; + // dieWithError prevents continuation default: $this->dieWithError( 'apierror-unknownerror-nocode', 'unknown-error', [ 'details' => [ 'code' => $verification['status'] ] ] ); - break; } } |