style: apply php-cs-fixer formatting (PSR-12)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-09 20:46:59 +01:00
parent dae215dd3d
commit 7506a7a3c1
234 changed files with 447 additions and 370 deletions

View File

@@ -18,7 +18,8 @@ final class ImportChapterController extends AbstractController
{
public function __construct(
private readonly ImportChapterHandler $commandHandler
) {}
) {
}
public function __invoke(Request $request): Response
{
@@ -139,7 +140,3 @@ final class ImportChapterController extends AbstractController
return $errors;
}
}

View File

@@ -16,7 +16,8 @@ final class ImportVolumeController extends AbstractController
{
public function __construct(
private readonly ImportVolumeHandler $commandHandler
) {}
) {
}
public function __invoke(Request $request): Response
{
@@ -132,7 +133,3 @@ final class ImportVolumeController extends AbstractController
return $errors;
}
}

View File

@@ -12,5 +12,6 @@ readonly class ChapterCollection
public int $limit,
public bool $hasNextPage,
public bool $hasPreviousPage
) {}
}
) {
}
}

View File

@@ -15,5 +15,6 @@ readonly class ChapterListItem
public bool $isVisible,
public bool $isAvailable,
public string $createdAt
) {}
}
) {
}
}

View File

@@ -18,4 +18,3 @@ readonly class FilenameMatchCollection
) {
}
}

View File

@@ -18,4 +18,3 @@ readonly class FilenameMatchItem
) {
}
}

View File

@@ -14,5 +14,6 @@ readonly class MangaCollection
public int $limit,
public bool $hasNextPage,
public bool $hasPreviousPage
) {}
}
) {
}
}

View File

@@ -22,5 +22,6 @@ readonly class MangaDetail
public ?string $thumbnailUrl,
public ?float $rating,
public bool $monitored
) {}
) {
}
}

View File

@@ -21,5 +21,6 @@ readonly class MangaListItem
public string $status,
public ?float $rating,
public DateTimeImmutable $createdAt,
) {}
) {
}
}

View File

@@ -7,5 +7,6 @@ readonly class MangaSearchCollection
public function __construct(
/** @var MangaSearchItem[] */
public array $items
) {}
}
) {
}
}

View File

@@ -19,5 +19,6 @@ readonly class MangaSearchItem
public ?string $imageUrl,
public ?string $thumbnailUrl,
public ?float $rating
) {}
) {
}
}

View File

@@ -58,4 +58,4 @@ class CreateMangaDirectlyResource
#[Assert\Type(type: 'float', message: 'La note doit être un nombre décimal')]
#[Assert\Range(min: 0, max: 5, notInRangeMessage: 'La note doit être comprise entre {{ min }} et {{ max }}')]
public ?float $rating = null;
}
}

View File

@@ -45,5 +45,6 @@ class DeleteCbzResource
{
public function __construct(
public string $id
) {}
) {
}
}

View File

@@ -45,5 +45,6 @@ class DeleteChapterResource
{
public function __construct(
public string $id
) {}
) {
}
}

View File

@@ -45,5 +45,6 @@ class DeleteMangaResource
{
public function __construct(
public string $id
) {}
) {
}
}

View File

@@ -21,5 +21,6 @@ class DownloadCbzResource
{
public function __construct(
public string $id
) {}
) {
}
}

View File

@@ -22,5 +22,6 @@ class DownloadVolumeResource
public function __construct(
public string $id,
public int $volume
) {}
) {
}
}

View File

@@ -28,7 +28,8 @@ class EditMultipleChaptersResource
#[Assert\NotBlank(message: 'La liste des chapitres est obligatoire')]
#[Assert\Count(min: 1, minMessage: 'Vous devez spécifier au moins un chapitre')]
public readonly array $chapters
) {}
) {
}
}
readonly class ChapterEditData
@@ -37,5 +38,6 @@ readonly class ChapterEditData
public string $id,
public ?string $title = null,
public ?int $volume = null
) {}
) {
}
}

View File

@@ -56,5 +56,6 @@ class FetchMangaChaptersResource
#[Assert\NotBlank(message: 'L\'identifiant du manga est obligatoire')]
// #[Assert\Uuid(message: 'L\'identifiant du manga doit être un UUID valide')]
public string $mangaId
) {}
) {
}
}

View File

@@ -108,4 +108,3 @@ class FindMangaMatchByFilenameResource
) {
}
}

View File

@@ -22,5 +22,6 @@ class GetMangaBySlugResource
{
public function __construct(
public string $slug
) {}
}
) {
}
}

View File

@@ -72,7 +72,3 @@ class ImportChapterResource
public ?File $file = null;
}

View File

@@ -72,7 +72,3 @@ class ImportVolumeResource
public ?File $file = null;
}

View File

@@ -63,4 +63,4 @@ use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaChaptersS
)]
class MangaChaptersResource
{
}
}

View File

@@ -20,4 +20,4 @@ use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaListState
)]
class MangaListResource
{
}
}

View File

@@ -32,4 +32,4 @@ use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaStateProv
)]
class MangaResource
{
}
}

View File

@@ -12,7 +12,8 @@ readonly class CreateMangaDirectlyProcessor implements ProcessorInterface
{
public function __construct(
private CreateMangaHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{
@@ -35,4 +36,4 @@ readonly class CreateMangaDirectlyProcessor implements ProcessorInterface
$this->handler->handle($command);
}
}
}

View File

@@ -13,7 +13,8 @@ readonly class CreateMangaProcessor implements ProcessorInterface
{
public function __construct(
private CreateMangaFromMangadexHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{
@@ -23,4 +24,4 @@ readonly class CreateMangaProcessor implements ProcessorInterface
throw new NotFoundHttpException($e->getMessage());
}
}
}
}

View File

@@ -12,7 +12,8 @@ readonly class DeleteCbzProcessor implements ProcessorInterface
{
public function __construct(
private DeleteCbzHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{

View File

@@ -13,7 +13,8 @@ readonly class DeleteChapterProcessor implements ProcessorInterface
{
public function __construct(
private DeleteChapterHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{

View File

@@ -14,7 +14,8 @@ readonly class DeleteMangaProcessor implements ProcessorInterface
{
public function __construct(
private DeleteMangaHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): int
{

View File

@@ -14,7 +14,8 @@ readonly class EditMangaProcessor implements ProcessorInterface
{
public function __construct(
private EditMangaHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{

View File

@@ -16,7 +16,8 @@ readonly class EditMultipleChaptersProcessor implements ProcessorInterface
{
public function __construct(
private EditMultipleChaptersHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): int
{

View File

@@ -13,7 +13,8 @@ readonly class FetchMangaChaptersProcessor implements ProcessorInterface
{
public function __construct(
private MessageBusInterface $messageBus
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{

View File

@@ -15,7 +15,8 @@ readonly class RefreshMangaChaptersProcessor implements ProcessorInterface
public function __construct(
private MessageBusInterface $commandBus,
private MangaRepositoryInterface $mangaRepository
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{

View File

@@ -15,7 +15,8 @@ readonly class ToggleMonitoringProcessor implements ProcessorInterface
{
public function __construct(
private ToggleMangaMonitoringHandler $handler
) {}
) {
}
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{

View File

@@ -14,7 +14,8 @@ readonly class DeleteCbzProvider implements ProviderInterface
{
public function __construct(
private ChapterRepositoryInterface $chapterRepository
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): DeleteCbzResource
{

View File

@@ -13,7 +13,8 @@ readonly class DeleteChapterProvider implements ProviderInterface
{
public function __construct(
private ChapterRepositoryInterface $chapterRepository
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): DeleteChapterResource
{

View File

@@ -13,7 +13,8 @@ readonly class DeleteMangaProvider implements ProviderInterface
{
public function __construct(
private MangaRepositoryInterface $mangaRepository
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): DeleteMangaResource
{

View File

@@ -15,7 +15,8 @@ readonly class DownloadCbzProvider implements ProviderInterface
{
public function __construct(
private DownloadCbzHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): Response
{

View File

@@ -15,7 +15,8 @@ readonly class DownloadVolumeProvider implements ProviderInterface
{
public function __construct(
private DownloadVolumeHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): Response
{

View File

@@ -33,7 +33,7 @@ readonly class FindMangaMatchByFilenameStateProvider implements ProviderInterfac
// Pour Get, on retourne directement la resource
return new FindMangaMatchByFilenameResource(
matches: array_map(
fn($match) => new FilenameMatchItem(
fn ($match) => new FilenameMatchItem(
id: $match->id,
title: $match->title,
slug: $match->slug,
@@ -48,4 +48,3 @@ readonly class FindMangaMatchByFilenameStateProvider implements ProviderInterfac
);
}
}

View File

@@ -12,7 +12,8 @@ readonly class GetMangaBySlugStateProvider implements ProviderInterface
{
public function __construct(
private GetMangaBySlugHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): MangaDetail
{

View File

@@ -14,7 +14,8 @@ readonly class GetMangaChaptersStateProvider implements ProviderInterface
{
public function __construct(
private GetMangaChaptersHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): ChapterCollection
{
@@ -56,4 +57,4 @@ readonly class GetMangaChaptersStateProvider implements ProviderInterface
createdAt: $chapter->createdAt->format(\DateTimeInterface::RFC3339)
);
}
}
}

View File

@@ -14,7 +14,8 @@ readonly class GetMangaListStateProvider implements ProviderInterface
{
public function __construct(
private GetMangaListHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): MangaCollection
{

View File

@@ -12,7 +12,8 @@ readonly class GetMangaStateProvider implements ProviderInterface
{
public function __construct(
private GetMangaByIdHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): MangaDetail
{

View File

@@ -14,7 +14,8 @@ readonly class SearchLocalMangaStateProvider implements ProviderInterface
{
public function __construct(
private SearchLocalMangaHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): MangaCollection
{

View File

@@ -13,7 +13,8 @@ readonly class SearchMangaStateProvider implements ProviderInterface
{
public function __construct(
private SearchMangaHandler $handler
) {}
) {
}
public function provide(Operation $operation, array $uriVariables = [], array $context = []): MangaSearchCollection
{
@@ -41,4 +42,4 @@ readonly class SearchMangaStateProvider implements ProviderInterface
)
);
}
}
}

View File

@@ -22,7 +22,8 @@ class MangadexClient implements MangadexClientInterface
private string $clientSecret,
private string $username,
private string $password
) {}
) {
}
public function authenticate(): void
{
@@ -161,4 +162,4 @@ class MangadexClient implements MangadexClientInterface
);
}
}
}
}

View File

@@ -11,10 +11,11 @@ readonly class SymfonyFetchMangaChaptersHandler
{
public function __construct(
private FetchMangaChaptersHandler $handler
) {}
) {
}
public function __invoke(FetchMangaChapters $command): void
{
$this->handler->handle($command);
}
}
}

View File

@@ -11,7 +11,8 @@ readonly class SymfonyRefreshMangaChaptersHandler
{
public function __construct(
private RefreshMangaChaptersHandler $handler
) {}
) {
}
public function __invoke(RefreshMangaChapters $command): void
{

View File

@@ -20,5 +20,3 @@ readonly class ChapterImportedMessageHandler
$this->listener->__invoke($event);
}
}

View File

@@ -20,5 +20,3 @@ readonly class VolumeImportedMessageHandler
$this->listener->__invoke($event);
}
}

View File

@@ -22,7 +22,8 @@ readonly class LegacyMangaRepository implements MangaRepositoryInterface
{
public function __construct(
private EntityManagerInterface $entityManager
) {}
) {
}
public function findAll(int $page = 1, int $limit = 20, string $sortBy = 'title', string $sortOrder = 'asc'): array
{
@@ -70,7 +71,7 @@ readonly class LegacyMangaRepository implements MangaRepositoryInterface
return $entity ? $this->toDomain($entity) : null;
}
public function save(DomainManga $manga): void
public function save(DomainManga $manga): void
{
// Check if this is an update (manga has a numeric ID) or a new creation
$entity = null;

View File

@@ -12,7 +12,8 @@ readonly class LegacyChapterRepository implements ChapterRepositoryInterface
{
public function __construct(
private EntityManagerInterface $entityManager
) {}
) {
}
public function findById(string $id): ?Chapter
{

View File

@@ -13,13 +13,13 @@ use App\Domain\Manga\Domain\Model\ValueObject\MangaTitle;
use Ramsey\Uuid\Uuid;
use Symfony\Component\String\Slugger\SluggerInterface;
readonly class MangadexProvider implements MangaProviderInterface
{
public function __construct(
private MangadexClientInterface $client,
private SluggerInterface $slugger
) {}
) {
}
public function search(string $title): MangaCollection
{

View File

@@ -15,7 +15,8 @@ class MonitoringSchedule implements ScheduleProviderInterface
{
public function __construct(
private CacheInterface $cache
) {}
) {
}
public function getSchedule(): Schedule
{

View File

@@ -12,7 +12,8 @@ readonly class FileService implements FileServiceInterface
{
public function __construct(
private string $cbzStoragePath = '/app/public/cbz'
) {}
) {
}
public function downloadCbz(string $filePath, string $filename): Response
{

View File

@@ -33,7 +33,7 @@ class ImageProcessor implements ImageProcessorInterface
{
try {
$response = $this->httpClient->get($imageUrl);
if ($response->getStatusCode() !== 200) {
throw new \RuntimeException('Échec du téléchargement de l\'image');
}
@@ -88,4 +88,4 @@ class ImageProcessor implements ImageProcessorInterface
}
}
}
}
}

View File

@@ -15,7 +15,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
public function __construct(
private MangadexClientInterface $mangadxClient,
private MangaRepositoryInterface $mangaRepository
) {}
) {
}
public function synchronizeChapters(Manga $manga): array
{
@@ -56,10 +57,10 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
// Si c'est le premier chapitre avec ce numéro qu'on rencontre
$shouldReplaceChapter = true;
$chapterNumbers[] = $chapterNumber;
} else if ($language === 'fr') {
} elseif ($language === 'fr') {
// Le français est toujours prioritaire
$shouldReplaceChapter = true;
} else if ($language === 'en' && $chapterLanguages[(string) $chapterNumber] !== 'fr') {
} elseif ($language === 'en' && $chapterLanguages[(string) $chapterNumber] !== 'fr') {
// L'anglais est prioritaire sur les autres langues, sauf le français
$shouldReplaceChapter = true;
}
@@ -114,7 +115,7 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
private function harmonizeVolumes(array &$chaptersByNumber): void
{
// Trie les chapitres par numéro pour faciliter la recherche des adjacents
uksort($chaptersByNumber, fn($a, $b) => (float)$a <=> (float)$b);
uksort($chaptersByNumber, fn ($a, $b) => (float)$a <=> (float)$b);
$chapterNumbers = array_keys($chaptersByNumber);
$count = count($chapterNumbers);
@@ -147,7 +148,7 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
);
}
// Règle 2: Si précédent et suivant ont le même volume, alors actuel aussi
else if ($prevVolume !== null && $prevVolume === $nextVolume && $currentVolume !== $prevVolume) {
elseif ($prevVolume !== null && $prevVolume === $nextVolume && $currentVolume !== $prevVolume) {
$chaptersByNumber[$currentChapterNum] = new Chapter(
new ChapterId($currentChapter->getId()),
$currentChapter->getMangaId(),
@@ -214,7 +215,7 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
);
}
// Si on a trouvé un volume suivant mais pas de précédent, utilise le suivant
else if ($nextVolume !== null && $prevVolume === null) {
elseif ($nextVolume !== null && $prevVolume === null) {
$chaptersByNumber[$currentChapterNum] = new Chapter(
new ChapterId($currentChapter->getId()),
$currentChapter->getMangaId(),