Skip to content

Commit a62c2b9

Browse files
authored
fix: Fix PHP 8.4 deprecations (#241)
1 parent 06d75c3 commit a62c2b9

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/Nodes/SVGNodeContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct()
4141
*
4242
* @return $this This node instance, for call chaining.
4343
*/
44-
public function addChild(SVGNode $node, int $index = null): SVGNodeContainer
44+
public function addChild(SVGNode $node, ?int $index = null): SVGNodeContainer
4545
{
4646
if ($node === $this || $node->parent === $this) {
4747
return $this;

src/Nodes/Shapes/SVGPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SVGPath extends SVGNodeContainer
1919
/**
2020
* @param string|null $d The path description.
2121
*/
22-
public function __construct(string $d = null)
22+
public function __construct(?string $d = null)
2323
{
2424
parent::__construct();
2525

src/Nodes/Shapes/SVGPolygonalShape.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
abstract class SVGPolygonalShape extends SVGNodeContainer
1313
{
1414
/**
15-
* @param array[] $points Array of points (float 2-tuples).
15+
* @param array[]|null $points Array of points (float 2-tuples).
1616
*/
17-
public function __construct(array $points = null)
17+
public function __construct(?array $points = null)
1818
{
1919
parent::__construct();
2020

21-
if (isset($points)) {
21+
if ($points !== null) {
2222
$this->setAttribute('points', self::joinPoints($points));
2323
}
2424
}

src/Nodes/Structures/SVGClipPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SVGClipPath extends SVGNodeContainer
1212
{
1313
public const TAG_NAME = 'clipPath';
1414

15-
public function __construct(string $id = null)
15+
public function __construct(?string $id = null)
1616
{
1717
parent::__construct();
1818

src/Rasterization/Transform/TransformParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class TransformParser
1515
* @param Transform|null $applyTo The optional starting Transform. If not provided, the identity will be used.
1616
* @return Transform Either the mutated argument transform, or the newly computed transform.
1717
*/
18-
public static function parseTransformString(?string $input, Transform $applyTo = null): Transform
18+
public static function parseTransformString(?string $input, ?Transform $applyTo = null): Transform
1919
{
2020
$transform = $applyTo ?? Transform::identity();
2121
if ($input === null) {

0 commit comments

Comments
 (0)