fix: phpcs-fixer

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-05 21:32:04 +01:00
parent ba874480ee
commit c55cd62ec7
65 changed files with 346 additions and 355 deletions

View File

@@ -49,8 +49,7 @@ class MangaController extends AbstractController
private readonly EntityManagerInterface $entityManager,
private readonly NotificationService $notificationService,
private readonly ContentSourceRepository $contentSourceRepository
)
{
) {
$this->imageManager = new ImageManager(new Driver());
}
@@ -75,7 +74,7 @@ class MangaController extends AbstractController
#[Route('/manga/chapters/{mangaSlug}', name: 'app_manga_show')]
public function showChapters(string $mangaSlug, Request $request): Response
{
// $manga = $this->mangaRepository->findOneWithChapterBy(['slug' => $mangaSlug]);
// $manga = $this->mangaRepository->findOneWithChapterBy(['slug' => $mangaSlug]);
$manga = $this->mangaRepository->findOneBy(['slug' => $mangaSlug]);
if (!$manga) {
@@ -98,7 +97,7 @@ class MangaController extends AbstractController
{
try {
foreach ($manga->getChapters() as $chapter) {
file_exists($chapter->getCbzPath()) ?? unlink($chapter->getCbzPath());
file_exists($chapter->getCbzPath()) ?? unlink($chapter->getCbzPath());
$this->entityManager->remove($chapter);
}
$this->entityManager->remove($manga);
@@ -135,8 +134,7 @@ class MangaController extends AbstractController
Request $request,
Manga $manga,
ContentSourceRepository $contentSourceRepository
): JsonResponse
{
): JsonResponse {
$data = json_decode($request->getContent(), true);
$preferredSourceIds = $data['preferredSources'] ?? [];
@@ -144,7 +142,7 @@ class MangaController extends AbstractController
// This will maintain the order of the sources as they were sent in the request
$orderedPreferredSources = array_map(
fn($id) => current(array_filter($preferredSources, fn($s) => $s->getId() == $id)),
fn ($id) => current(array_filter($preferredSources, fn ($s) => $s->getId() == $id)),
$preferredSourceIds
);
@@ -194,7 +192,7 @@ class MangaController extends AbstractController
return new JsonResponse(['error' => 'No CBZ path for this chapter.'], 400);
}
file_exists($cbzPath) ?? unlink($cbzPath);
file_exists($cbzPath) ?? unlink($cbzPath);
$chapter->setCbzPath(null);
$this->entityManager->persist($chapter);