refactor: move WikidataAwardGateway to src/Gateway/WikidataGateway.php

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-31 11:14:20 +02:00
parent ecfc80c349
commit 6cbebb6367
2 changed files with 5 additions and 4 deletions

View File

@@ -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';

View File

@@ -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;
} }