chore: reorganizing
This commit is contained in:
@@ -28,7 +28,8 @@ Les données proviennent de la filmographie Letterboxd de l'utilisateur : seuls
|
||||
src/
|
||||
├── Controller/ # Contrôleurs (Game, Import, Auth)
|
||||
├── 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
|
||||
├── Gateway/ # Intégrations externes (TMDB, Wikidata, Letterboxd)
|
||||
├── Message/ # Messages async (ProcessImport, ImportFilmsBatch)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace App\Controller;
|
||||
use App\Entity\Game;
|
||||
use App\Entity\User;
|
||||
use App\Repository\GameRepository;
|
||||
use App\Service\GameGridGenerator;
|
||||
use App\Provider\GameGridProvider;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -19,7 +19,7 @@ class GameController extends AbstractController
|
||||
#[Route('/game/start', name: 'app_game_start', methods: ['POST'])]
|
||||
public function start(
|
||||
Request $request,
|
||||
GameGridGenerator $generator,
|
||||
GameGridProvider $generator,
|
||||
GameRepository $gameRepository,
|
||||
): Response {
|
||||
$this->validateCsrfToken('game_start', $request);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace App\Controller;
|
||||
use App\Entity\Game;
|
||||
use App\Entity\User;
|
||||
use App\Repository\GameRepository;
|
||||
use App\Service\GameGridGenerator;
|
||||
use App\Provider\GameGridProvider;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -19,7 +19,7 @@ class HomepageController extends AbstractController
|
||||
public function index(
|
||||
Request $request,
|
||||
GameRepository $gameRepository,
|
||||
GameGridGenerator $gridGenerator,
|
||||
GameGridProvider $gridGenerator,
|
||||
): Response {
|
||||
/** @var User|null $user */
|
||||
$user = $this->getUser();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
namespace App\Import;
|
||||
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Movie;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
namespace App\Import;
|
||||
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Award;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
namespace App\Import;
|
||||
|
||||
use App\Entity\Movie;
|
||||
use App\Exception\GatewayException;
|
||||
@@ -9,9 +9,9 @@ use App\Entity\UserMovie;
|
||||
use App\Gateway\LtbxdGateway;
|
||||
use App\Message\ImportFilmsBatchMessage;
|
||||
use App\Repository\ImportRepository;
|
||||
use App\Service\ActorSyncer;
|
||||
use App\Service\AwardImporter;
|
||||
use App\Service\FilmImporter;
|
||||
use App\Import\ActorSyncer;
|
||||
use App\Import\AwardImporter;
|
||||
use App\Import\FilmImporter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use League\Flysystem\FilesystemOperator;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
namespace App\Provider;
|
||||
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Game;
|
||||
@@ -14,7 +14,7 @@ use App\Repository\MovieRoleRepository;
|
||||
use App\Repository\AwardRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
class GameGridGenerator
|
||||
class GameGridProvider
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ActorRepository $actorRepository,
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Service;
|
||||
namespace App\Tests\Import;
|
||||
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Award;
|
||||
use App\Entity\AwardType;
|
||||
use App\Gateway\WikidataGateway;
|
||||
use App\Repository\AwardTypeRepository;
|
||||
use App\Service\AwardImporter;
|
||||
use App\Import\AwardImporter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Service;
|
||||
namespace App\Tests\Provider;
|
||||
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Award;
|
||||
@@ -12,11 +12,11 @@ use App\Repository\ActorRepository;
|
||||
use App\Repository\AwardRepository;
|
||||
use App\Repository\MovieRepository;
|
||||
use App\Repository\MovieRoleRepository;
|
||||
use App\Service\GameGridGenerator;
|
||||
use App\Provider\GameGridProvider;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class GameGridGeneratorTest extends TestCase
|
||||
class GameGridProviderTest extends TestCase
|
||||
{
|
||||
public function testResolveHintTextForAward(): void
|
||||
{
|
||||
@@ -35,7 +35,7 @@ class GameGridGeneratorTest extends TestCase
|
||||
$awardRepository = $this->createMock(AwardRepository::class);
|
||||
$awardRepository->method('find')->with(42)->willReturn($award);
|
||||
|
||||
$generator = new GameGridGenerator(
|
||||
$generator = new GameGridProvider(
|
||||
$this->createMock(ActorRepository::class),
|
||||
$this->createMock(MovieRoleRepository::class),
|
||||
$this->createMock(MovieRepository::class),
|
||||
Reference in New Issue
Block a user