From f4d7a7e0fb016721b69866f2c70f9d9e32fb1094 Mon Sep 17 00:00:00 2001 From: Niellles <10075507+Niellles@users.noreply.github.com> Date: Sun, 10 Dec 2023 00:03:20 +0100 Subject: [PATCH 1/2] fix: Deprecation notices Removed deprecation notices for dynamic properties and implicit int conversions. --- src/Rasterization/Renderers/MultiPassRenderer.php | 2 +- tests/Rasterization/Path/ArcApproximatorTest.php | 4 ++-- tests/Reading/SVGReaderTest.php | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) 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 { From b30442726d58381a52f3164117a0a9c89b433b11 Mon Sep 17 00:00:00 2001 From: Niellles <10075507+Niellles@users.noreply.github.com> Date: Sun, 10 Dec 2023 00:09:27 +0100 Subject: [PATCH 2/2] chore(ci): Run CI tests on 8.3. CI tests now run on 8.3 too, also readme now reflects support for 8.3. --- .github/workflows/php.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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