build: Disable phan option scalar_implicit_cast and make pass

Change-Id: I30c11acd17334f292c7a83dba49cf59d182728f3
This commit is contained in:
Umherirrender 2021-09-26 13:45:58 +02:00
parent 85fbb12dbe
commit 44e2d41b8f
3 changed files with 5 additions and 9 deletions

View file

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

View file

@ -230,7 +230,7 @@ class PdfHandler extends ImageHandler {
"-quality",
$wgPdfHandlerJpegQuality,
"-resize",
$width,
(string)$width,
"-",
$dstPath
);
@ -304,7 +304,7 @@ class PdfHandler extends ImageHandler {
/**
* @param File $file
* @return bool
* @return bool|int
*/
public function isFileMetadataValid( $file ) {
$data = $file->getMetadataItems( [ 'mergedMetadata', 'pages' ] );

View file

@ -81,9 +81,9 @@ class PdfImage {
}
$size = explode( 'x', $pageSize, 2 );
$width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
$width = intval( (int)trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
$height = explode( ' ', trim( $size[1] ), 2 );
$height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
$height = intval( (int)trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
if ( ( $pageRotation / 90 ) & 1 ) {
// Swap width and height for landscape pages
$temp = $width;