Skip to content

Commit e1f7790

Browse files
Use ??= more
1 parent 4e02ecf commit e1f7790

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Node/ArrayNode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ public function __construct()
2929

3030
public function addElement(Node $value, Node $key = null)
3131
{
32-
if (null === $key) {
33-
$key = new ConstantNode(++$this->index);
34-
}
32+
$key ??= new ConstantNode(++$this->index);
3533

3634
array_push($this->nodes, $key, $value);
3735
}

0 commit comments

Comments
 (0)