chore: reorganizing

This commit is contained in:
thibaud-leclere
2026-04-01 19:24:04 +02:00
parent 0e3b17bb7d
commit 087b063f1f
10 changed files with 20 additions and 19 deletions

View File

@@ -28,7 +28,8 @@ Les données proviennent de la filmographie Letterboxd de l'utilisateur : seuls
src/ src/
├── Controller/ # Contrôleurs (Game, Import, Auth) ├── Controller/ # Contrôleurs (Game, Import, Auth)
├── Entity/ # Entités Doctrine (Game, Actor, Movie, Award...) ├── Entity/ # Entités Doctrine (Game, Actor, Movie, Award...)
├── Service/ # Logique métier (GameGridGenerator, FilmImporter, ActorSyncer, AwardImporter) ├── Provider/ # Fournisseurs de données (GameGridProvider)
├── Import/ # Import de données externes (FilmImporter, ActorSyncer, AwardImporter)
├── Repository/ # Requêtes Doctrine ├── Repository/ # Requêtes Doctrine
├── Gateway/ # Intégrations externes (TMDB, Wikidata, Letterboxd) ├── Gateway/ # Intégrations externes (TMDB, Wikidata, Letterboxd)
├── Message/ # Messages async (ProcessImport, ImportFilmsBatch) ├── Message/ # Messages async (ProcessImport, ImportFilmsBatch)

View File

@@ -7,7 +7,7 @@ namespace App\Controller;
use App\Entity\Game; use App\Entity\Game;
use App\Entity\User; use App\Entity\User;
use App\Repository\GameRepository; use App\Repository\GameRepository;
use App\Service\GameGridGenerator; use App\Provider\GameGridProvider;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@@ -19,7 +19,7 @@ class GameController extends AbstractController
#[Route('/game/start', name: 'app_game_start', methods: ['POST'])] #[Route('/game/start', name: 'app_game_start', methods: ['POST'])]
public function start( public function start(
Request $request, Request $request,
GameGridGenerator $generator, GameGridProvider $generator,
GameRepository $gameRepository, GameRepository $gameRepository,
): Response { ): Response {
$this->validateCsrfToken('game_start', $request); $this->validateCsrfToken('game_start', $request);

View File

@@ -7,7 +7,7 @@ namespace App\Controller;
use App\Entity\Game; use App\Entity\Game;
use App\Entity\User; use App\Entity\User;
use App\Repository\GameRepository; use App\Repository\GameRepository;
use App\Service\GameGridGenerator; use App\Provider\GameGridProvider;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@@ -19,7 +19,7 @@ class HomepageController extends AbstractController
public function index( public function index(
Request $request, Request $request,
GameRepository $gameRepository, GameRepository $gameRepository,
GameGridGenerator $gridGenerator, GameGridProvider $gridGenerator,
): Response { ): Response {
/** @var User|null $user */ /** @var User|null $user */
$user = $this->getUser(); $user = $this->getUser();

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Service; namespace App\Import;
use App\Entity\Actor; use App\Entity\Actor;
use App\Entity\Movie; use App\Entity\Movie;

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Service; namespace App\Import;
use App\Entity\Actor; use App\Entity\Actor;
use App\Entity\Award; use App\Entity\Award;

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Service; namespace App\Import;
use App\Entity\Movie; use App\Entity\Movie;
use App\Exception\GatewayException; use App\Exception\GatewayException;

View File

@@ -9,9 +9,9 @@ use App\Entity\UserMovie;
use App\Gateway\LtbxdGateway; use App\Gateway\LtbxdGateway;
use App\Message\ImportFilmsBatchMessage; use App\Message\ImportFilmsBatchMessage;
use App\Repository\ImportRepository; use App\Repository\ImportRepository;
use App\Service\ActorSyncer; use App\Import\ActorSyncer;
use App\Service\AwardImporter; use App\Import\AwardImporter;
use App\Service\FilmImporter; use App\Import\FilmImporter;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use League\Flysystem\FilesystemOperator; use League\Flysystem\FilesystemOperator;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Service; namespace App\Provider;
use App\Entity\Actor; use App\Entity\Actor;
use App\Entity\Game; use App\Entity\Game;
@@ -14,7 +14,7 @@ use App\Repository\MovieRoleRepository;
use App\Repository\AwardRepository; use App\Repository\AwardRepository;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
class GameGridGenerator class GameGridProvider
{ {
public function __construct( public function __construct(
private readonly ActorRepository $actorRepository, private readonly ActorRepository $actorRepository,

View File

@@ -2,14 +2,14 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Tests\Service; namespace App\Tests\Import;
use App\Entity\Actor; use App\Entity\Actor;
use App\Entity\Award; use App\Entity\Award;
use App\Entity\AwardType; use App\Entity\AwardType;
use App\Gateway\WikidataGateway; use App\Gateway\WikidataGateway;
use App\Repository\AwardTypeRepository; use App\Repository\AwardTypeRepository;
use App\Service\AwardImporter; use App\Import\AwardImporter;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Tests\Service; namespace App\Tests\Provider;
use App\Entity\Actor; use App\Entity\Actor;
use App\Entity\Award; use App\Entity\Award;
@@ -12,11 +12,11 @@ use App\Repository\ActorRepository;
use App\Repository\AwardRepository; use App\Repository\AwardRepository;
use App\Repository\MovieRepository; use App\Repository\MovieRepository;
use App\Repository\MovieRoleRepository; use App\Repository\MovieRoleRepository;
use App\Service\GameGridGenerator; use App\Provider\GameGridProvider;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
class GameGridGeneratorTest extends TestCase class GameGridProviderTest extends TestCase
{ {
public function testResolveHintTextForAward(): void public function testResolveHintTextForAward(): void
{ {
@@ -35,7 +35,7 @@ class GameGridGeneratorTest extends TestCase
$awardRepository = $this->createMock(AwardRepository::class); $awardRepository = $this->createMock(AwardRepository::class);
$awardRepository->method('find')->with(42)->willReturn($award); $awardRepository->method('find')->with(42)->willReturn($award);
$generator = new GameGridGenerator( $generator = new GameGridProvider(
$this->createMock(ActorRepository::class), $this->createMock(ActorRepository::class),
$this->createMock(MovieRoleRepository::class), $this->createMock(MovieRoleRepository::class),
$this->createMock(MovieRepository::class), $this->createMock(MovieRepository::class),