Code Duplication    Length = 7-7 lines in 2 locations

includes/upload/UploadStash.php 1 location

@@ 256-262 (lines=7) @@
253
			// which is probably useless to the caller.
254
			$error = $storeStatus->getErrorsArray();
255
			$error = reset( $error );
256
			if ( !count( $error ) ) {
257
				$error = $storeStatus->getWarningsArray();
258
				$error = reset( $error );
259
				if ( !count( $error ) ) {
260
					$error = [ 'unknown', 'no error recorded' ];
261
				}
262
			}
263
			// At this point, $error should contain the single "most important"
264
			// error, plus any parameters.
265
			$errorMsg = array_shift( $error );

includes/upload/UploadFromChunks.php 1 location

@@ 331-337 (lines=7) @@
328
		if ( !$storeStatus->isOK() ) {
329
			$error = $storeStatus->getErrorsArray();
330
			$error = reset( $error );
331
			if ( !count( $error ) ) {
332
				$error = $storeStatus->getWarningsArray();
333
				$error = reset( $error );
334
				if ( !count( $error ) ) {
335
					$error = [ 'unknown', 'no error recorded' ];
336
				}
337
			}
338
			throw new UploadChunkFileException( "Error storing file in '$chunkPath': " .
339
				implode( '; ', $error ) );
340
		}