mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-24 22:18:00 +01:00
More consice PHP
This commit is contained in:
parent
8f71b408ef
commit
9c8402644b
1 changed files with 2 additions and 5 deletions
|
@ -105,10 +105,7 @@ class Favourite extends Model
|
||||||
public function getTypeAttribute()
|
public function getTypeAttribute()
|
||||||
{
|
{
|
||||||
// As of PHP 7.2, get_class is picky about null args
|
// As of PHP 7.2, get_class is picky about null args
|
||||||
if ($resource = $this->resource) {
|
$resource = $this->resource;
|
||||||
return get_class($resource);
|
return $resource ? get_class($resource) : null;
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue