diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6fc683df..705d16c8 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2'] + php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 791e518f..5501ad15 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Contributions are very welcome. [Find out how to contribute](#contributing). PHP-SVG is free of dependencies. All it needs is a PHP installation satisfying the following requirements: -* PHP version 7.3 or newer. This library is tested against all versions up to (and including) PHP 8.2. +* PHP version 7.3 or newer. This library is tested against all versions up to (and including) PHP 8.3. * If you wish to load SVG files, or strings containing SVG code, you need to have the ['simplexml' PHP extension](https://www.php.net/manual/en/book.simplexml.php). * If you wish to use the rasterization feature for converting SVGs to raster images (PNGs, JPEGs, ...), you need to diff --git a/src/Rasterization/Renderers/MultiPassRenderer.php b/src/Rasterization/Renderers/MultiPassRenderer.php index 8876f810..8ddaa2f7 100644 --- a/src/Rasterization/Renderers/MultiPassRenderer.php +++ b/src/Rasterization/Renderers/MultiPassRenderer.php @@ -164,7 +164,7 @@ private static function prepareColor(?string $color, SVGNode $context, float $sp $opacity = self::calculateTotalOpacity($context) * $specificOpacity; $a = 127 - $opacity * (int) ($color[3] * 127 / 255); - return $rgb | ($a << 24); + return $rgb | ((int)$a << 24); } /** diff --git a/tests/Rasterization/Path/ArcApproximatorTest.php b/tests/Rasterization/Path/ArcApproximatorTest.php index 12bf4535..75efdbea 100644 --- a/tests/Rasterization/Path/ArcApproximatorTest.php +++ b/tests/Rasterization/Path/ArcApproximatorTest.php @@ -143,7 +143,7 @@ public function testApproximateRadiusScaling() $this->assertEqualsWithDelta(20, $result[$n - 1][0], 0.1); $this->assertEqualsWithDelta(10, $result[$n - 1][1], 0.1); // test some point roughly in the middle - $this->assertEqualsWithDelta(15, $result[$n / 2][0], 1); - $this->assertEqualsWithDelta(15, $result[$n / 2][1], 1); + $this->assertEqualsWithDelta(15, $result[(int)($n / 2)][0], 1); + $this->assertEqualsWithDelta(15, $result[(int)($n / 2)][1], 1); } } diff --git a/tests/Reading/SVGReaderTest.php b/tests/Reading/SVGReaderTest.php index 862c91eb..a9fb7bbc 100644 --- a/tests/Reading/SVGReaderTest.php +++ b/tests/Reading/SVGReaderTest.php @@ -17,6 +17,8 @@ class SVGReaderTest extends \PHPUnit\Framework\TestCase private $xmlUnknown; private $xmlValue; private $xmlEntities; + private $xmlNoXmlns; + private $xmlOnlyOtherXmlns; public function setUp(): void {