Skip to content

Commit

Permalink
refactor: Use elvis operator
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 29, 2024
1 parent 6a39e1c commit 5ccc284
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ public function fetchFieldDataByCantoId(string $cantoId): ?CantoFieldData
}

return new CantoFieldData([
'cantoId' => $responseBody['id'] ?? 0,
'cantoId' => $responseBody['id'] ?: 0,
'cantoAlbumId' => 0,
'cantoAssetData' => [$responseBody],
'cantoAlbumData' => [
'id' => $responseBody['relatedAlbums'][0]['id'] ?? 0,
'name' => $responseBody['relatedAlbums'][0]['name'] ?? '',
'id' => $responseBody['relatedAlbums'][0]['id'] ?: 0,

Check failure on line 118 in src/services/Api.php

View workflow job for this annotation

GitHub Actions / PHPStan

Offset 'id' does not exist on string.
'name' => $responseBody['relatedAlbums'][0]['name'] ?: '',

Check failure on line 119 in src/services/Api.php

View workflow job for this annotation

GitHub Actions / PHPStan

Offset 'name' does not exist on string.
],
]);
}
Expand Down

0 comments on commit 5ccc284

Please sign in to comment.