Skip to content

Commit b426599

Browse files
committed
fix psalm-reported type problems
1 parent 4cd02ad commit b426599

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

codepoints.net/lib/Controller/OGImage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __invoke($match, Array $env) : string {
3434
http_response_code(404);
3535
return '';
3636
}
37-
$svg = preg_replace(
37+
$svg = (string)preg_replace(
3838
'/viewBox="[^"]+"/',
3939
sprintf('viewBox="-50 0 %s %s"', $dbimage['width'] + 100, $dbimage['height'] + 100),
4040
$dbimage['image']);
@@ -57,7 +57,7 @@ public function __invoke($match, Array $env) : string {
5757
};
5858
$svgimg->blurImage($blur, $blur);
5959
}
60-
$svgimg->resizeImage(ceil(min(400, 400 * $ratio)), ceil(min(400, 400 / $ratio)), imagick::FILTER_LANCZOS, 1);
60+
$svgimg->resizeImage((int)ceil(min(400, 400 * $ratio)), (int)ceil(min(400, 400 / $ratio)), imagick::FILTER_LANCZOS, 1);
6161
$img->compositeImage($svgimg, Imagick::COMPOSITE_DEFAULT, 50 + (int)((400 - $svgimg->getImageWidth()) / 2), 50);
6262

6363
$name = case_cp_name($cp->name);

0 commit comments

Comments
 (0)