Skip to content

Commit 3c202b2

Browse files
Remove PHP version check in imagepolygon() and imagefilledpolygon()
1 parent 6838a6d commit 3c202b2

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/Renderer/Image.php

+2-11
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939

4040
use const E_WARNING;
4141
use const PHP_MAJOR_VERSION;
42-
use const PHP_VERSION_ID;
4342

4443
/**
4544
* Class for rendering the barcode as image
@@ -397,7 +396,7 @@ protected function drawPolygon($points, $color, $filled = true)
397396
$color & 0x0000FF
398397
);
399398

400-
$this->imageFilledPolygonWrapper($this->resource, $newPoints, 4, $allocatedColor, $filled);
399+
$this->imageFilledPolygonWrapper($this->resource, $newPoints, $allocatedColor, $filled);
401400
}
402401

403402
/**
@@ -490,24 +489,16 @@ protected function drawText($text, $size, $position, $font, $color, $alignment =
490489
/**
491490
* @param GdImage|resource $image
492491
* @param array $points
493-
* @param int $numPoints
494492
* @param int $color
495493
* @param bool $filled
496494
* @return bool
497495
*/
498-
protected function imageFilledPolygonWrapper($image, array $points, $numPoints, $color, $filled)
496+
protected function imageFilledPolygonWrapper($image, array $points, $color, $filled)
499497
{
500498
if (! $filled) {
501-
if (PHP_VERSION_ID < 80100) {
502-
return imagepolygon($this->resource, $points, $numPoints, $color);
503-
}
504499
return imagepolygon($this->resource, $points, $color);
505500
}
506501

507-
if (PHP_VERSION_ID < 80100) {
508-
return imagefilledpolygon($image, $points, $numPoints, $color);
509-
}
510-
511502
return imagefilledpolygon($image, $points, $color);
512503
}
513504

0 commit comments

Comments
 (0)