From 40cfc3f649dbff34c078f05148e4a0704940d3fa Mon Sep 17 00:00:00 2001 From: Casper Bakker Date: Tue, 1 Oct 2024 21:28:12 +0200 Subject: [PATCH] Fix phpstan --- src/Renderers/PngRenderer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Renderers/PngRenderer.php b/src/Renderers/PngRenderer.php index 4fd6e68..72c2909 100644 --- a/src/Renderers/PngRenderer.php +++ b/src/Renderers/PngRenderer.php @@ -54,8 +54,8 @@ public function useGd(): self // Example: $width = $barcode->getWidth() * 3 public function render(Barcode $barcode, float $width = 200, float $height = 30): string { - $width = round($width); - $height = round($height); + $width = (int)round($width); + $height = (int)round($height); $widthFactor = $width / $barcode->getWidth(); @@ -80,9 +80,9 @@ public function render(Barcode $barcode, float $width = 200, float $height = 30) // draw a vertical bar if ($this->useImagick) { - $imagickBarsShape->rectangle(round($positionHorizontal), $y, round($positionHorizontal + $barWidth - 1), ($y + $barHeight)); + $imagickBarsShape->rectangle((int)round($positionHorizontal), $y, (int)round($positionHorizontal + $barWidth - 1), ($y + $barHeight)); } else { - \imagefilledrectangle($image, round($positionHorizontal), $y, round($positionHorizontal + $barWidth - 1), ($y + $barHeight), $gdForegroundColor); + \imagefilledrectangle($image, (int)round($positionHorizontal), $y, (int)round($positionHorizontal + $barWidth - 1), ($y + $barHeight), $gdForegroundColor); } } $positionHorizontal += $barWidth;