mirror of
https://github.com/AzuraCast/AzuraCast.git
synced 2024-06-14 05:06:37 +00:00
Set the station config classes to return {}
when empty and serialized to JSON.
This commit is contained in:
parent
b1662a4757
commit
1a68f34452
|
@ -29,9 +29,13 @@ abstract class AbstractStationConfiguration implements JsonSerializable
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize(): array
|
public function jsonSerialize(): array|object
|
||||||
{
|
{
|
||||||
return $this->toArray();
|
$result = $this->toArray();
|
||||||
|
|
||||||
|
return (0 !== count($result))
|
||||||
|
? $result
|
||||||
|
: (object)[];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get(string $key, mixed $default = null): mixed
|
protected function get(string $key, mixed $default = null): mixed
|
||||||
|
|
Loading…
Reference in New Issue
Block a user