Shift bindings

PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser.
This commit is contained in:
Laravel Shift 2021-02-14 02:39:58 +00:00
parent 3e1869f7e6
commit 3573bed220

View file

@ -69,10 +69,10 @@ class ArtistsController extends ApiControllerBase
$albums = [];
foreach ($favs as $fav) {
if ($fav->type == 'App\Models\Track') {
if ($fav->type == \App\Models\Track::class) {
$tracks[] = Track::mapPublicTrackSummary($fav->track);
} else {
if ($fav->type == 'App\Models\Album') {
if ($fav->type == \App\Models\Album::class) {
$albums[] = Album::mapPublicAlbumSummary($fav->album);
}
}