chore: move Spotify client to Integrations

This commit is contained in:
Phan An 2024-03-22 16:33:04 +01:00
parent a501613052
commit a4366fe3b1
4 changed files with 4 additions and 27 deletions

View file

@ -1,6 +1,6 @@
<?php
namespace App\Services\ApiClients;
namespace App\Http\Integrations\Spotify;
use App\Exceptions\SpotifyIntegrationDisabledException;
use App\Services\SpotifyService;

View file

@ -2,9 +2,9 @@
namespace App\Services;
use App\Http\Integrations\Spotify\SpotifyClient;
use App\Models\Album;
use App\Models\Artist;
use App\Services\ApiClients\SpotifyClient;
use Illuminate\Support\Arr;
class SpotifyService
@ -45,7 +45,7 @@ class SpotifyService
}
return Arr::get(
$this->client->search("{$album->name} artist:{$album->artist->name}", 'album', ['limit' => 1]),
$this->client->search("$album->name artist:{$album->artist->name}", 'album', ['limit' => 1]),
'albums.items.0.images.0.url'
);
}

View file

@ -2,9 +2,9 @@
namespace Tests\Unit\Services;
use App\Http\Integrations\Spotify\SpotifyClient;
use App\Models\Album;
use App\Models\Artist;
use App\Services\ApiClients\SpotifyClient;
use App\Services\SpotifyService;
use Illuminate\Support\Facades\File;
use Mockery;

View file

@ -1,23 +0,0 @@
<?php
namespace Tests\Unit\Stubs;
use App\Services\ApiClients\ApiClient;
class ConcreteApiClient extends ApiClient
{
public function getKey(): string
{
return 'bar';
}
public function getSecret(): string
{
return 'secret';
}
public function getEndpoint(): string
{
return 'https://foo.com';
}
}