refactor: move WikidataAwardGateway to src/Gateway/WikidataGateway.php
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Service;
|
namespace App\Gateway;
|
||||||
|
|
||||||
use App\Entity\Actor;
|
use App\Entity\Actor;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
|
|
||||||
class WikidataAwardGateway
|
class WikidataGateway
|
||||||
{
|
{
|
||||||
private const SPARQL_ENDPOINT = 'https://query.wikidata.org/sparql';
|
private const SPARQL_ENDPOINT = 'https://query.wikidata.org/sparql';
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ use App\Entity\User;
|
|||||||
use App\Repository\ActorRepository;
|
use App\Repository\ActorRepository;
|
||||||
use App\Repository\MovieRepository;
|
use App\Repository\MovieRepository;
|
||||||
use App\Repository\MovieRoleRepository;
|
use App\Repository\MovieRoleRepository;
|
||||||
|
use App\Gateway\WikidataGateway;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
class GameGridGenerator
|
class GameGridGenerator
|
||||||
@@ -19,7 +20,7 @@ class GameGridGenerator
|
|||||||
private readonly ActorRepository $actorRepository,
|
private readonly ActorRepository $actorRepository,
|
||||||
private readonly MovieRoleRepository $movieRoleRepository,
|
private readonly MovieRoleRepository $movieRoleRepository,
|
||||||
private readonly MovieRepository $movieRepository,
|
private readonly MovieRepository $movieRepository,
|
||||||
private readonly WikidataAwardGateway $wikidataAwardGateway,
|
private readonly WikidataGateway $wikidataGateway,
|
||||||
private readonly EntityManagerInterface $em,
|
private readonly EntityManagerInterface $em,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@@ -173,7 +174,7 @@ class GameGridGenerator
|
|||||||
|
|
||||||
case 'award':
|
case 'award':
|
||||||
try {
|
try {
|
||||||
$awards = $this->wikidataAwardGateway->getAwards($rowActor);
|
$awards = $this->wikidataGateway->getAwards($rowActor);
|
||||||
} catch (\Throwable) {
|
} catch (\Throwable) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user