Skip to content

Commit 5e00750

Browse files
committed
fix: Change constructor parameter to nullable type
Fix "Implicitly marking parameter $StateBearer as nullable is deprecated" since php 8.4
1 parent 32278af commit 5e00750

File tree

13 files changed

+13
-13
lines changed

13 files changed

+13
-13
lines changed

src/Components/Block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ interface Block extends Component
1717
public static function build(
1818
Context $Context,
1919
State $State,
20-
Block $Block = null
20+
?Block $Block = null
2121
);
2222
}

src/Components/Blocks/BlockQuote.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private function __construct($Lines)
3535
public static function build(
3636
Context $Context,
3737
State $State,
38-
Block $Block = null
38+
?Block $Block = null
3939
) {
4040
if (\preg_match('/^(>[ \t]?+)(.*+)/', $Context->line()->text(), $matches)) {
4141
$indentOffset = $Context->line()->indentOffset() + $Context->line()->indent() + \strlen($matches[1]);

src/Components/Blocks/FencedCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private function __construct($code, $infostring, $marker, $openerLength, $isComp
5151
public static function build(
5252
Context $Context,
5353
State $State,
54-
Block $Block = null
54+
?Block $Block = null
5555
) {
5656
$marker = \substr($Context->line()->text(), 0, 1);
5757

src/Components/Blocks/Header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private function __construct($text, $level)
3939
public static function build(
4040
Context $Context,
4141
State $State,
42-
Block $Block = null
42+
?Block $Block = null
4343
) {
4444
if ($Context->line()->indent() > 3) {
4545
return null;

src/Components/Blocks/IndentedCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private function __construct($code)
3232
public static function build(
3333
Context $Context,
3434
State $State,
35-
Block $Block = null
35+
?Block $Block = null
3636
) {
3737
if (isset($Block) && $Block instanceof Paragraph && ! ($Context->precedingEmptyLines() > 0)) {
3838
return null;

src/Components/Blocks/Markup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function __construct($html, $type, $closed = false)
124124
public static function build(
125125
Context $Context,
126126
State $State,
127-
Block $Block = null
127+
?Block $Block = null
128128
) {
129129
$text = $Context->line()->text();
130130
$rawLine = $Context->line()->rawLine();

src/Components/Blocks/Paragraph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private function __construct($text)
3232
public static function build(
3333
Context $Context,
3434
State $State,
35-
Block $Block = null
35+
?Block $Block = null
3636
) {
3737
return new self($Context->line()->text());
3838
}

src/Components/Blocks/Reference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private function __construct(State $State)
2828
public static function build(
2929
Context $Context,
3030
State $State,
31-
Block $Block = null
31+
?Block $Block = null
3232
) {
3333
if (\preg_match(
3434
'/^\[(.+?)\]:[ ]*+<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*+$/',

src/Components/Blocks/Rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ private function __construct()
2222
public static function build(
2323
Context $Context,
2424
State $State,
25-
Block $Block = null
25+
?Block $Block = null
2626
) {
2727
if ($Context->line()->indent() > 3) {
2828
return null;

src/Components/Blocks/SetextHeader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private function __construct($text, $level)
3939
public static function build(
4040
Context $Context,
4141
State $State,
42-
Block $Block = null
42+
?Block $Block = null
4343
) {
4444
if (! isset($Block) || ! $Block instanceof Paragraph || $Context->precedingEmptyLines() > 0) {
4545
return null;

0 commit comments

Comments
 (0)