Skip to content

Commit

Permalink
Remove PHP version check in imagepolygon() and imagefilledpolygon()
Browse files Browse the repository at this point in the history
  • Loading branch information
ls-youssef-jlidat committed May 16, 2024
1 parent 6838a6d commit 94081b8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/Renderer/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ protected function drawPolygon($points, $color, $filled = true)
$color & 0x0000FF
);

$this->imageFilledPolygonWrapper($this->resource, $newPoints, 4, $allocatedColor, $filled);
$this->imageFilledPolygonWrapper($this->resource, $newPoints, $allocatedColor, $filled);
}

/**
Expand Down Expand Up @@ -490,24 +490,16 @@ protected function drawText($text, $size, $position, $font, $color, $alignment =
/**
* @param GdImage|resource $image
* @param array $points
* @param int $numPoints
* @param int $color
* @param bool $filled
* @return bool
*/
protected function imageFilledPolygonWrapper($image, array $points, $numPoints, $color, $filled)
protected function imageFilledPolygonWrapper($image, array $points, $color, $filled)
{
if (! $filled) {
if (PHP_VERSION_ID < 80100) {
return imagepolygon($this->resource, $points, $numPoints, $color);
}
return imagepolygon($this->resource, $points, $color);
}

if (PHP_VERSION_ID < 80100) {
return imagefilledpolygon($image, $points, $numPoints, $color);
}

return imagefilledpolygon($image, $points, $color);
}

Expand Down

0 comments on commit 94081b8

Please sign in to comment.