Merge "Revert explict casts and use implict casts as before"

This commit is contained in:
jenkins-bot 2020-01-12 09:22:16 +00:00 committed by Gerrit Code Review
commit a66de934a7
3 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,7 @@
<?php
return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg['scalar_implicit_cast'] = true;
return $cfg;

View file

@ -212,7 +212,7 @@ class PdfHandler extends ImageHandler {
"-quality",
$wgPdfHandlerJpegQuality,
"-resize",
(string)$width,
$width,
"-",
$dstPath
);
@ -329,7 +329,7 @@ class PdfHandler extends ImageHandler {
/**
* @param File $image
* @param string $metadata
* @return bool|int
* @return bool
*/
public function isMetadataValid( $image, $metadata ) {
if ( !$metadata || $metadata === serialize( [] ) ) {

View file

@ -93,9 +93,9 @@ class PdfImage {
$size = explode( 'x', $o, 2 );
if ( $size ) {
$width = intval( trim( $size[0] ) ) / 72 * $wgPdfHandlerDpi;
$width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
$height = explode( ' ', trim( $size[1] ), 2 );
$height = intval( trim( $height[0] ) ) / 72 * $wgPdfHandlerDpi;
$height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
if ( ( $r / 90 ) & 1 ) {
// Swap width and height for landscape pages
$t = $width;