Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Run CI on PHP 8.3 and fix deprecation notices #211

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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