mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
a8a3baa478
This reverts commit 7cd5b230d4
.
30 lines
652 B
PHP
30 lines
652 B
PHP
<?php
|
|
|
|
namespace App\Values;
|
|
|
|
use Illuminate\Contracts\Support\Arrayable;
|
|
use JsonSerializable;
|
|
|
|
final class UserPreferences implements Arrayable, JsonSerializable
|
|
{
|
|
private function __construct(public ?string $lastFmSessionKey = null)
|
|
{
|
|
}
|
|
|
|
public static function make(?string $lastFmSessionKey = null): self
|
|
{
|
|
return new self($lastFmSessionKey);
|
|
}
|
|
|
|
/** @return array<mixed> */
|
|
public function toArray(): array
|
|
{
|
|
return ['lastfm_session_key' => $this->lastFmSessionKey];
|
|
}
|
|
|
|
/** @return array<mixed> */
|
|
public function jsonSerialize(): array
|
|
{
|
|
return $this->toArray();
|
|
}
|
|
}
|