Skip to content

Commit

Permalink
Use ??= more
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 2, 2022
1 parent 4e02ecf commit e1f7790
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Node/ArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public function __construct()

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

array_push($this->nodes, $key, $value);
}
Expand Down

0 comments on commit e1f7790

Please sign in to comment.