Skip to content

Commit de7888e

Browse files
committed
Merge remote-tracking branch 'origin/master'
split: 5b726dc15ef2bacbe76a8e2f20731238f5a7ecfe
1 parent d8329f7 commit de7888e

31 files changed

Lines changed: 44 additions & 44 deletions

Compiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public function getBlocks()
499499
*
500500
* @return ElementInterface
501501
*/
502-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
502+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
503503
{
504504
$nodeEvent = new NodeEvent($node);
505505
$this->trigger($nodeEvent);
@@ -537,7 +537,7 @@ public function compileNode(NodeInterface $node, ElementInterface $parent = null
537537
* @param BlockElement $block
538538
* @param array $children
539539
*/
540-
public function replaceBlock(BlockElement $block, array $children = null)
540+
public function replaceBlock(BlockElement $block, ?array $children = null)
541541
{
542542
if ($parent = $block->getParent()) {
543543
foreach (array_reverse($children ?: $block->getChildren()) as $child) {

Compiler/AbstractNodeCompiler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function getCompiler()
4141
*
4242
* @return ElementInterface[]
4343
*/
44-
public function getCompiledNodeList($nodeList, ElementInterface $element = null)
44+
public function getCompiledNodeList($nodeList, ?ElementInterface $element = null)
4545
{
4646
return array_values(array_filter(array_map(
4747
function (NodeInterface $childNode) use ($element) {
@@ -59,7 +59,7 @@ function (NodeInterface $childNode) use ($element) {
5959
*
6060
* @return ElementInterface[]
6161
*/
62-
public function getCompiledChildren(NodeInterface $node, ElementInterface $element = null)
62+
public function getCompiledChildren(NodeInterface $node, ?ElementInterface $element = null)
6363
{
6464
return $this->getCompiledNodeList($node->getChildren(), $element);
6565
}
@@ -71,7 +71,7 @@ public function getCompiledChildren(NodeInterface $node, ElementInterface $eleme
7171
* @param NodeInterface $node
7272
* @param ElementInterface|null $element
7373
*/
74-
public function compileNodeChildren(NodeInterface $node, ElementInterface $element = null)
74+
public function compileNodeChildren(NodeInterface $node, ?ElementInterface $element = null)
7575
{
7676
$children = array_filter($node->getChildren());
7777
array_walk($children, function (NodeInterface $childNode) use ($element) {
@@ -109,7 +109,7 @@ protected function getTextChildren(ParserNodeInterface $node)
109109
}, $children));
110110
}
111111

112-
private function compileParserNode(NodeInterface $node, ElementInterface $element = null)
112+
private function compileParserNode(NodeInterface $node, ?ElementInterface $element = null)
113113
{
114114
return $node instanceof ParserNodeInterface
115115
? $this->getCompiler()->compileNode($node, $element)

Compiler/Element/BlockElement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class BlockElement extends AbstractElement
2222
public function __construct(
2323
CompilerInterface $compiler,
2424
$name = '',
25-
ParserNode $originNode = null,
26-
NodeInterface $parent = null,
27-
array $children = null
25+
?ParserNode $originNode = null,
26+
?NodeInterface $parent = null,
27+
?array $children = null
2828
) {
2929
$blocks = &$compiler->getBlocksByName($name);
3030
$blocks[] = $this;

Compiler/NodeCompiler/AssignmentListNodeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class AssignmentListNodeCompiler extends AbstractNodeCompiler
1111
{
12-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
1313
{
1414
$this->getCompiler()->assert(
1515
$node instanceof AssignmentListNode,

Compiler/NodeCompiler/AssignmentNodeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class AssignmentNodeCompiler extends AbstractNodeCompiler
1515
{
16-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
16+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
1717
{
1818
$this->getCompiler()->assert(
1919
$node instanceof AssignmentNode,

Compiler/NodeCompiler/AttributeListNodeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class AttributeListNodeCompiler extends AbstractNodeCompiler
1111
{
12-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
1313
{
1414
$this->getCompiler()->assert(
1515
$node instanceof AttributeListNode,

Compiler/NodeCompiler/AttributeNodeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function compileValue(AttributeNode $node)
5757
return $value;
5858
}
5959

60-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
60+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
6161
{
6262
$this->getCompiler()->assert(
6363
$node instanceof AttributeNode,

Compiler/NodeCompiler/BlockNodeCompiler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class BlockNodeCompiler extends AbstractNodeCompiler
1414
{
15-
protected function compileAnonymousBlock(BlockNode $node, ElementInterface $parent = null)
15+
protected function compileAnonymousBlock(BlockNode $node, ?ElementInterface $parent = null)
1616
{
1717
$mixin = $node;
1818
while ($mixin->hasParent() && !($mixin instanceof MixinNode)) {
@@ -38,7 +38,7 @@ protected function hasBlockParent(BlockNode $node)
3838
return false;
3939
}
4040

41-
protected function compileNamedBlock($name, BlockNode $node, ElementInterface $parent = null)
41+
protected function compileNamedBlock($name, BlockNode $node, ?ElementInterface $parent = null)
4242
{
4343
$compiler = $this->getCompiler();
4444
$layout = $compiler->getLayout();
@@ -63,7 +63,7 @@ protected function compileNamedBlock($name, BlockNode $node, ElementInterface $p
6363
);
6464
}
6565

66-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
66+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
6767
{
6868
$this->getCompiler()->assert(
6969
$node instanceof BlockNode,

Compiler/NodeCompiler/CaseNodeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class CaseNodeCompiler extends AbstractStatementNodeCompiler
1010
{
11-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
11+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
1212
{
1313
$this->getCompiler()->assert(
1414
$node instanceof CaseNode,

Compiler/NodeCompiler/CodeNodeCompiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class CodeNodeCompiler extends AbstractNodeCompiler
1414
{
15-
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
15+
public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
1616
{
1717
$this->getCompiler()->assert(
1818
$node instanceof CodeNode,
@@ -42,7 +42,7 @@ public function compileNode(NodeInterface $node, ElementInterface $parent = null
4242
return $code;
4343
}
4444

45-
private function getCodeElement(CodeNode $node, array $texts, array $children, ElementInterface $parent = null)
45+
private function getCodeElement(CodeNode $node, array $texts, array $children, ?ElementInterface $parent = null)
4646
{
4747
if (count($texts) === count($children)) {
4848
return new CodeElement($this->getTextChildren($node), $node);

0 commit comments

Comments
 (0)