Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
casperbakker committed Oct 1, 2024
1 parent 1a6071e commit 40cfc3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Renderers/PngRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
Expand Down

0 comments on commit 40cfc3f

Please sign in to comment.