feat: refonte du gestionnaire de chapitres pour intégrer la génération de fichiers CBZ, le téléchargement d'images en lot et la gestion des requêtes de scraping, avec mise à jour des interfaces et des modèles associés

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-03-28 20:42:21 +01:00
parent cdee6f77fc
commit d7088b14c2
22 changed files with 620 additions and 195 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Tests\Domain\Scraping\Adapter;
use App\Domain\Scraping\Domain\Contract\Repository\MangaRepositoryInterface;
use App\Domain\Scraping\Domain\Model\Manga;
class InMemoryMangaRepository implements MangaRepositoryInterface
{
private array $mangas = [];
public function __construct()
{
// Ajoute un manga par défaut pour les tests
$this->mangas['test-manga'] = new Manga(
'test-manga',
'Test Manga',
'test-manga',
'2024',
'Test Author',
'A test manga description'
);
}
public function getById(string $id): Manga
{
if (!isset($this->mangas[$id])) {
throw new \RuntimeException('Manga not found');
}
return $this->mangas[$id];
}
public function save(Manga $manga): void
{
$this->mangas[$manga->getId()] = $manga;
}
public function clear(): void
{
$this->mangas = [];
}
}