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 <?php
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php'; return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg['scalar_implicit_cast'] = true;
return $cfg;

View file

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

View file

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