Service configs can be null

This commit is contained in:
Phan An 2018-08-29 17:36:05 +07:00
parent 8638c229a8
commit 6eae3b53a2
5 changed files with 8 additions and 8 deletions

View file

@ -129,5 +129,5 @@ abstract class ApiClient
abstract public function getSecret(): ?string;
abstract public function getEndpoint(): string;
abstract public function getEndpoint(): ?string;
}

View file

@ -4,7 +4,7 @@ namespace App\Services;
interface ApiConsumerInterface
{
public function getEndpoint(): string;
public function getEndpoint(): ?string;
public function getKey(): ?string;

View file

@ -320,17 +320,17 @@ class LastfmService extends ApiClient implements ApiConsumerInterface
return trim(str_replace('Read more on Last.fm', '', nl2br(strip_tags(html_entity_decode($str)))));
}
public function getKey(): string
public function getKey(): ?string
{
return config('koel.lastfm.key');
}
public function getEndpoint(): string
public function getEndpoint(): ?string
{
return config('koel.lastfm.endpoint');
}
public function getSecret(): string
public function getSecret(): ?string
{
return config('koel.lastfm.secret');
}

View file

@ -58,12 +58,12 @@ class YouTubeService extends ApiClient implements ApiConsumerInterface
});
}
public function getEndpoint(): string
public function getEndpoint(): ?string
{
return config('koel.youtube.endpoint');
}
public function getKey(): string
public function getKey(): ?string
{
return config('koel.youtube.key');
}

View file

@ -78,7 +78,7 @@ class iTunesService extends ApiClient implements ApiConsumerInterface
return null;
}
public function getEndpoint(): string
public function getEndpoint(): ?string
{
return config('koel.itunes.endpoint');
}