diff --git a/src/Renderer/Image.php b/src/Renderer/Image.php index 290d942e..2f43fbd2 100644 --- a/src/Renderer/Image.php +++ b/src/Renderer/Image.php @@ -39,7 +39,6 @@ use const E_WARNING; use const PHP_MAJOR_VERSION; -use const PHP_VERSION_ID; /** * Class for rendering the barcode as image @@ -397,7 +396,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); } /** @@ -490,19 +489,14 @@ 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) { - return imagepolygon($this->resource, $points, $numPoints, $color); - } - - if (PHP_VERSION_ID < 80100) { - return imagefilledpolygon($image, $points, $numPoints, $color); + return imagepolygon($this->resource, $points, $color); } return imagefilledpolygon($image, $points, $color); diff --git a/test/FactoryTest.php b/test/FactoryTest.php index 1bdaca96..aac9403b 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -55,12 +55,10 @@ public function setUp(): void $r = new ReflectionClass(Barcode\Barcode::class); $rObjectPlugins = $r->getProperty('objectPlugins'); - $rObjectPlugins->setAccessible(true); - $rObjectPlugins->setValue(null); + $rObjectPlugins->setValue($r, null); $rRendererPlugins = $r->getProperty('rendererPlugins'); - $rRendererPlugins->setAccessible(true); - $rRendererPlugins->setValue(null); + $rRendererPlugins->setValue($r, null); } public function tearDown(): void