Skip to content

Commit

Permalink
use null coalescing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-s-r committed Jun 17, 2022
1 parent 79dc43a commit 57e44b4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/SnapshotRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public function getAll(): Collection
->filter(function (string $fileName) {
$pathinfo = pathinfo($fileName);

if (
array_key_exists('extension', $pathinfo)
&& $pathinfo['extension'] === 'gz'
) {
if (($pathinfo['extension'] ?? null) === 'gz') {
$fileName = $pathinfo['filename'];
}

Expand Down

0 comments on commit 57e44b4

Please sign in to comment.