update phpstan

This commit is contained in:
Yuri Kuznetsov
2024-01-30 11:40:31 +02:00
parent 696a25fe82
commit a3fe58f61b
8 changed files with 24 additions and 25 deletions
+6 -6
View File
@@ -238,9 +238,9 @@ class Image implements EntryPoint
throw new Error();
}
list($originalWidth, $originalHeight) = getimagesize($filePath);
[$originalWidth, $originalHeight] = getimagesize($filePath);
list($width, $height) = $this->getSizes()[$size];
[$width, $height] = $this->getSizes()[$size];
if ($originalWidth <= $width && $originalHeight <= $height) {
$targetWidth = $originalWidth;
@@ -249,19 +249,19 @@ class Image implements EntryPoint
else {
if ($originalWidth > $originalHeight) {
$targetWidth = $width;
$targetHeight = $originalHeight / ($originalWidth / $width);
$targetHeight = (int) ($originalHeight / ($originalWidth / $width));
if ($targetHeight > $height) {
$targetHeight = $height;
$targetWidth = $originalWidth / ($originalHeight / $height);
$targetWidth = (int) ($originalWidth / ($originalHeight / $height));
}
} else {
$targetHeight = $height;
$targetWidth = $originalWidth / ($originalHeight / $height);
$targetWidth = (int) ($originalWidth / ($originalHeight / $height));
if ($targetWidth > $width) {
$targetWidth = $width;
$targetHeight = $originalHeight / ($originalWidth / $width);
$targetHeight = (int) ($originalHeight / ($originalWidth / $width));
}
}
}