Skip to content

Commit 40cfc3f

Browse files
committed
Fix phpstan
1 parent 1a6071e commit 40cfc3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/Renderers/PngRenderer.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function useGd(): self
5454
// Example: $width = $barcode->getWidth() * 3
5555
public function render(Barcode $barcode, float $width = 200, float $height = 30): string
5656
{
57-
$width = round($width);
58-
$height = round($height);
57+
$width = (int)round($width);
58+
$height = (int)round($height);
5959

6060
$widthFactor = $width / $barcode->getWidth();
6161

@@ -80,9 +80,9 @@ public function render(Barcode $barcode, float $width = 200, float $height = 30)
8080

8181
// draw a vertical bar
8282
if ($this->useImagick) {
83-
$imagickBarsShape->rectangle(round($positionHorizontal), $y, round($positionHorizontal + $barWidth - 1), ($y + $barHeight));
83+
$imagickBarsShape->rectangle((int)round($positionHorizontal), $y, (int)round($positionHorizontal + $barWidth - 1), ($y + $barHeight));
8484
} else {
85-
\imagefilledrectangle($image, round($positionHorizontal), $y, round($positionHorizontal + $barWidth - 1), ($y + $barHeight), $gdForegroundColor);
85+
\imagefilledrectangle($image, (int)round($positionHorizontal), $y, (int)round($positionHorizontal + $barWidth - 1), ($y + $barHeight), $gdForegroundColor);
8686
}
8787
}
8888
$positionHorizontal += $barWidth;

0 commit comments

Comments
 (0)