From 82a695259c2c8cd2ee5d43be23bbe54c9aaa3bb6 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sat, 7 Jun 2025 17:23:40 +0200 Subject: [PATCH 1/3] fix php 8.4 deprecations --- CHANGELOG.md | 6 ++++++ src/Render.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7405a9..9ee32dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Fixed + +- PHP `8.4` deprecations + ## 4.1.0 - 2023-09-17 ### Added diff --git a/src/Render.php b/src/Render.php index 90e04e3..17dc157 100644 --- a/src/Render.php +++ b/src/Render.php @@ -27,7 +27,7 @@ final class Render private Link $link; private FormatPath $formatPath; - private function __construct(Link $link = null, FormatPath $formatPath = null) + private function __construct(?Link $link = null, ?FormatPath $formatPath = null) { $this->link = $link ?? new Link\ToFile; $this->formatPath = $formatPath ?? new FormatPath\FullPath; @@ -63,7 +63,7 @@ public function __invoke(StackTrace $stack): Content /** * @psalm-pure */ - public static function of(Link $link = null, FormatPath $formatPath = null): self + public static function of(?Link $link = null, ?FormatPath $formatPath = null): self { return new self($link, $formatPath); } From 6026544432fa51f13348195d1f6044dc22b1aba2 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sat, 7 Jun 2025 17:23:44 +0200 Subject: [PATCH 2/3] CS --- tests/ThrowableTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/ThrowableTest.php b/tests/ThrowableTest.php index 0e131ff..cbbea74 100644 --- a/tests/ThrowableTest.php +++ b/tests/ThrowableTest.php @@ -5,7 +5,6 @@ use Innmind\StackTrace\{ Throwable, - CallFrame, ClassName, Line, }; From c6ed5ad87053a27d9e71177ab70707c754f6f81f Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sat, 7 Jun 2025 17:25:33 +0200 Subject: [PATCH 3/3] fix test --- tests/ThrowableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ThrowableTest.php b/tests/ThrowableTest.php index cbbea74..0d34d43 100644 --- a/tests/ThrowableTest.php +++ b/tests/ThrowableTest.php @@ -29,7 +29,7 @@ public function testInterface() $this->assertInstanceOf(Url::class, $throwable->file()); $this->assertSame('file://'.__FILE__, $throwable->file()->toString()); $this->assertInstanceOf(Line::class, $throwable->line()); - $this->assertSame(23, $throwable->line()->toInt()); + $this->assertSame(22, $throwable->line()->toInt()); $this->assertInstanceOf(Sequence::class, $throwable->trace()); $this->assertCount(12, $throwable->trace()); $this->assertSame(