From c10c2ddde452abfe71255fd7aa80bd122799c7d2 Mon Sep 17 00:00:00 2001 From: abzolv <70450336+gnito-org@users.noreply.github.com> Date: Thu, 26 Dec 2024 09:44:41 -0400 Subject: [PATCH 1/2] Fix PHP 8.4 deprecations --- Parsedown.php | 2 +- test/ParsedownTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 38edfe92e..d4197ebd3 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -346,7 +346,7 @@ protected function isBlockCompletable($Type) # # Code - protected function blockCode($Line, $Block = null) + protected function blockCode($Line, ?$Block = null) { if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) { diff --git a/test/ParsedownTest.php b/test/ParsedownTest.php index bf4031759..5e8e758e4 100755 --- a/test/ParsedownTest.php +++ b/test/ParsedownTest.php @@ -5,7 +5,7 @@ class ParsedownTest extends TestCase { - final function __construct($name = null, array $data = array(), $dataName = '') + final function __construct(?$name = null, array $data = array(), $dataName = '') { $this->dirs = $this->initDirs(); $this->Parsedown = $this->initParsedown(); From 5a23f0e9635770dd14653c8325fd62928cbf63e7 Mon Sep 17 00:00:00 2001 From: abzolv <70450336+gnito-org@users.noreply.github.com> Date: Thu, 26 Dec 2024 13:33:25 -0400 Subject: [PATCH 2/2] Revert wrong changes --- Parsedown.php | 2 +- test/ParsedownTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index d4197ebd3..38edfe92e 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -346,7 +346,7 @@ protected function isBlockCompletable($Type) # # Code - protected function blockCode($Line, ?$Block = null) + protected function blockCode($Line, $Block = null) { if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) { diff --git a/test/ParsedownTest.php b/test/ParsedownTest.php index 5e8e758e4..bf4031759 100755 --- a/test/ParsedownTest.php +++ b/test/ParsedownTest.php @@ -5,7 +5,7 @@ class ParsedownTest extends TestCase { - final function __construct(?$name = null, array $data = array(), $dataName = '') + final function __construct($name = null, array $data = array(), $dataName = '') { $this->dirs = $this->initDirs(); $this->Parsedown = $this->initParsedown();