Skip to content

Commit 4064f97

Browse files
thiemowmdeWMDE bot
authored andcommitted
Make use of modern ?? and ??= syntax where it makes sense
I feel like this makes the code more compact and more readable. The syntax especially avoids any repetition. I used a few regex patterns to find these places, but made all changes carefully by hand, not automatically. Change-Id: I131e69b55be0aeba32ceda45a6229cb40a3a812d
1 parent a130aef commit 4064f97

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/Snak/SnakList.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ private function setElement( $index, $value ) {
255255
return;
256256
}
257257

258-
if ( $index === null ) {
259-
$index = $this->getNewOffset();
260-
}
258+
$index ??= $this->getNewOffset();
261259

262260
$hash = $value->getHash();
263261
$this->offsetHashes[$hash] = $index;

0 commit comments

Comments
 (0)