Skip to content

Commit

Permalink
Remove two unneeded null checks flagged by PhpStan
Browse files Browse the repository at this point in the history
Technically, it's possible that title or filename is null on a Track object.
But that could happen only if the Track class is used very wrong.
  • Loading branch information
paulijar committed Nov 12, 2022
1 parent 2582e75 commit e45282e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Db/Track.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function toSubsonicApi(IL10N $l10n) : array {
'id' => 'track-' . $this->getId(),
'parent' => 'album-' . $albumId,
//'discNumber' => $this->getDisk(), // not supported on any of the tested clients => adjust track number instead
'title' => $this->getTitle() ?? '',
'title' => $this->getTitle(),
'artist' => $this->getArtistNameString($l10n),
'isDir' => false,
'album' => $this->getAlbumNameString($l10n),
Expand Down Expand Up @@ -287,7 +287,7 @@ public function getAdjustedTrackNumber(bool $enablePlaylistNumbering=true) : ?in
}

public function getFileExtension() : string {
$parts = \explode('.', $this->getFilename() ?? '');
$parts = \explode('.', $this->getFilename());
return \end($parts);
}

Expand Down

0 comments on commit e45282e

Please # to comment.