Skip to content

Commit

Permalink
fix: Run CI on PHP 8.3 and fix deprecation notices (#211)
Browse files Browse the repository at this point in the history
* fix: Deprecation notices

Removed deprecation notices for dynamic properties and implicit int conversions.

* chore(ci): Run CI tests on 8.3.

CI tests now run on 8.3 too, also readme now reflects support for 8.3.
  • Loading branch information
Niellles authored Dec 9, 2023
1 parent bf0a110 commit f50d39e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Rasterization/Renderers/MultiPassRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Rasterization/Path/ArcApproximatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 2 additions & 0 deletions tests/Reading/SVGReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class SVGReaderTest extends \PHPUnit\Framework\TestCase
private $xmlUnknown;
private $xmlValue;
private $xmlEntities;
private $xmlNoXmlns;
private $xmlOnlyOtherXmlns;

public function setUp(): void
{
Expand Down

0 comments on commit f50d39e

Please sign in to comment.