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

@@ -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(),