aboutsummaryrefslogtreecommitdiffstats
path: root/thumb.php
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2015-09-01 00:45:12 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2015-09-01 00:45:12 +0000
commit2f3fddb0d9695ff25113c553f87aa0f3ee3832f3 (patch)
treee199f613256746657801cba2eb4cc187559c16d7 /thumb.php
parent5254ff682c22a8f7e69f2aa1f090bcc51424756e (diff)
parentb49e7242f71ae37ab52152b3eb785ad800af0e3b (diff)
downloadmediawikicore-2f3fddb0d9695ff25113c553f87aa0f3ee3832f3.tar.gz
mediawikicore-2f3fddb0d9695ff25113c553f87aa0f3ee3832f3.zip
Merge "Fixed and suppressed some thumb.php IDEA errors"
Diffstat (limited to 'thumb.php')
-rw-r--r--thumb.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/thumb.php b/thumb.php
index f5eb8c991e29..d39d43bc4619 100644
--- a/thumb.php
+++ b/thumb.php
@@ -190,6 +190,7 @@ function wfStreamThumb( array $params ) {
if ( $targetFile->exists() ) {
$newThumbName = $targetFile->thumbName( $params );
if ( $isOld ) {
+ /** @var array $bits */
$newThumbUrl = $targetFile->getArchiveThumbUrl(
$bits[0] . '!' . $targetFile->getName(), $newThumbName );
} else {
@@ -325,7 +326,7 @@ function wfStreamThumb( array $params ) {
list( $thumb, $errorMsg ) = wfGenerateThumbnail( $img, $params, $thumbName, $thumbPath );
- /** @var MediaTransformOutput|bool $thumb */
+ /** @var MediaTransformOutput|MediaTransformError|bool $thumb */
// Check for thumbnail generation errors...
$msg = wfMessage( 'thumbnail_error' );
@@ -415,7 +416,7 @@ function wfGenerateThumbnail( File $file, array $params, $thumbName, $thumbPath
'fallback' => function () {
return wfMessage( 'generic-pool-error' )->parse();
},
- 'error' => function ( $status ) {
+ 'error' => function ( Status $status ) {
return $status->getHTML();
}
)
@@ -430,6 +431,7 @@ function wfGenerateThumbnail( File $file, array $params, $thumbName, $thumbPath
// Tried to select a page on a non-paged file?
}
+ /** @noinspection PhpUnusedLocalVariableInspection */
$done = true; // no PHP fatal occured
if ( !$thumb || $thumb->isError() ) {
@@ -500,7 +502,7 @@ function wfExtractThumbRequestInfo( $thumbRel ) {
*/
function wfExtractThumbParams( $file, $params ) {
if ( !isset( $params['thumbName'] ) ) {
- throw new MWException( "No thumbnail name passed to wfExtractThumbParams" );
+ throw new InvalidArgumentException( "No thumbnail name passed to wfExtractThumbParams" );
}
$thumbname = $params['thumbName'];
@@ -539,7 +541,7 @@ function wfExtractThumbParams( $file, $params ) {
// As a last ditch fallback, use the traditional common parameters
if ( preg_match( '!^(page(\d*)-)*(\d*)px-[^/]*$!', $thumbname, $matches ) ) {
- list( /* all */, $pagefull, $pagenum, $size ) = $matches;
+ list( /* all */, /* pagefull */, $pagenum, $size ) = $matches;
$params['width'] = $size;
if ( $pagenum ) {
$params['page'] = $pagenum;
@@ -554,7 +556,7 @@ function wfExtractThumbParams( $file, $params ) {
* Output a thumbnail generation error message
*
* @param int $status
- * @param string $msg Plain text (will be html escaped)
+ * @param string $msgText Plain text (will be html escaped)
* @return void
*/
function wfThumbErrorText( $status, $msgText ) {