diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index 098ba17..22a032e 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -15,7 +15,7 @@ class SecurityController extends AbstractController #[Route('/login', name: 'app_login', methods: ['GET', 'POST'])] public function login(IriConverterInterface $iriConverter, #[CurrentUser] User $user = null): Response { - if(!$user) { + if (!$user) { return $this->json([ 'error' => 'Invalid credentials' ], 401); diff --git a/src/Controller/SettingsController.php b/src/Controller/SettingsController.php index ef06c1d..6b1f100 100644 --- a/src/Controller/SettingsController.php +++ b/src/Controller/SettingsController.php @@ -8,7 +8,6 @@ use App\Form\ContentSourceType; use App\Manager\AppSettingsManager; use App\Manager\Toolbar\Factory\ToolbarFactory; use App\Repository\ContentSourceRepository; - use App\Service\NotificationService; use App\Service\Scraper\MangaScraperService; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Controller/TestController.php b/src/Controller/TestController.php index 0122023..af3fdef 100644 --- a/src/Controller/TestController.php +++ b/src/Controller/TestController.php @@ -46,7 +46,7 @@ class TestController extends AbstractController $changed = 0; foreach ($mangas as $manga) { //si getImageUrl() retourne un lien sous la forme d'une URL (https ou http) - if($manga->getImageUrl()) { + if ($manga->getImageUrl()) { $imageUrls = $this->processAndSaveImage($manga->getImageUrl()); $manga->setThumbnailUrl($imageUrls['thumbnail']); $this->mangaRepository->save($manga, true); diff --git a/src/Domain/Conversion/Application/Command/ConvertFileCommand.php b/src/Domain/Conversion/Application/Command/ConvertFileCommand.php index bdc6d9a..75e64c7 100644 --- a/src/Domain/Conversion/Application/Command/ConvertFileCommand.php +++ b/src/Domain/Conversion/Application/Command/ConvertFileCommand.php @@ -8,5 +8,6 @@ final readonly class ConvertFileCommand public string $filePath, public string $originalFilename, public int $fileSize - ) {} + ) { + } } diff --git a/src/Domain/Conversion/Application/CommandHandler/ConvertFileCommandHandler.php b/src/Domain/Conversion/Application/CommandHandler/ConvertFileCommandHandler.php index baddf04..1279589 100644 --- a/src/Domain/Conversion/Application/CommandHandler/ConvertFileCommandHandler.php +++ b/src/Domain/Conversion/Application/CommandHandler/ConvertFileCommandHandler.php @@ -14,7 +14,8 @@ final readonly class ConvertFileCommandHandler public function __construct( private ConversionServiceInterface $conversionService - ) {} + ) { + } public function handle(ConvertFileCommand $command): ConversionResponse { diff --git a/src/Domain/Conversion/Application/Response/ConversionResponse.php b/src/Domain/Conversion/Application/Response/ConversionResponse.php index 02077e9..220287b 100644 --- a/src/Domain/Conversion/Application/Response/ConversionResponse.php +++ b/src/Domain/Conversion/Application/Response/ConversionResponse.php @@ -11,7 +11,8 @@ final readonly class ConversionResponse public string $outputFilename, public int $originalFileSize, public int $convertedFileSize - ) {} + ) { + } public static function fromConversionResult(ConversionResult $result): self { diff --git a/src/Domain/Conversion/Domain/Model/ConversionRequest.php b/src/Domain/Conversion/Domain/Model/ConversionRequest.php index 4cdd7ef..ed7f817 100644 --- a/src/Domain/Conversion/Domain/Model/ConversionRequest.php +++ b/src/Domain/Conversion/Domain/Model/ConversionRequest.php @@ -8,7 +8,8 @@ final readonly class ConversionRequest private string $filePath, private string $originalFilename, private int $fileSize - ) {} + ) { + } public function getFilePath(): string { diff --git a/src/Domain/Conversion/Domain/Model/ConversionResult.php b/src/Domain/Conversion/Domain/Model/ConversionResult.php index bbe2573..8c94a15 100644 --- a/src/Domain/Conversion/Domain/Model/ConversionResult.php +++ b/src/Domain/Conversion/Domain/Model/ConversionResult.php @@ -9,7 +9,8 @@ final readonly class ConversionResult private string $outputFilename, private int $originalFileSize, private int $convertedFileSize - ) {} + ) { + } public function getConvertedFilePath(): string { diff --git a/src/Domain/Conversion/Infrastructure/ApiPlatform/Controller/ConvertFileController.php b/src/Domain/Conversion/Infrastructure/ApiPlatform/Controller/ConvertFileController.php index 6ee5edd..6ff189f 100644 --- a/src/Domain/Conversion/Infrastructure/ApiPlatform/Controller/ConvertFileController.php +++ b/src/Domain/Conversion/Infrastructure/ApiPlatform/Controller/ConvertFileController.php @@ -17,7 +17,8 @@ final class ConvertFileController extends AbstractController { public function __construct( private readonly ConvertFileCommandHandler $commandHandler - ) {} + ) { + } public function __invoke(Request $request): Response { diff --git a/src/Domain/Manga/Application/Command/ChapterEditData.php b/src/Domain/Manga/Application/Command/ChapterEditData.php index cbf52d6..f73c749 100644 --- a/src/Domain/Manga/Application/Command/ChapterEditData.php +++ b/src/Domain/Manga/Application/Command/ChapterEditData.php @@ -8,5 +8,6 @@ readonly class ChapterEditData public string $id, public ?string $title = null, public ?int $volume = null - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/CheckMonitoredMangas.php b/src/Domain/Manga/Application/Command/CheckMonitoredMangas.php index 508b24b..d0ff19a 100644 --- a/src/Domain/Manga/Application/Command/CheckMonitoredMangas.php +++ b/src/Domain/Manga/Application/Command/CheckMonitoredMangas.php @@ -8,5 +8,6 @@ readonly class CheckMonitoredMangas { public function __construct( public ?DateTimeImmutable $since = null - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/CreateManga.php b/src/Domain/Manga/Application/Command/CreateManga.php index b24dd0b..ab8858e 100644 --- a/src/Domain/Manga/Application/Command/CreateManga.php +++ b/src/Domain/Manga/Application/Command/CreateManga.php @@ -15,5 +15,6 @@ readonly class CreateManga public ?string $externalId, public ?string $imageUrl, public ?float $rating - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/Command/CreateMangaFromMangadex.php b/src/Domain/Manga/Application/Command/CreateMangaFromMangadex.php index 50c5962..7d3b17a 100644 --- a/src/Domain/Manga/Application/Command/CreateMangaFromMangadex.php +++ b/src/Domain/Manga/Application/Command/CreateMangaFromMangadex.php @@ -6,5 +6,6 @@ readonly class CreateMangaFromMangadex { public function __construct( public string $externalId - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/Command/DeleteCbz.php b/src/Domain/Manga/Application/Command/DeleteCbz.php index d4dde54..d483802 100644 --- a/src/Domain/Manga/Application/Command/DeleteCbz.php +++ b/src/Domain/Manga/Application/Command/DeleteCbz.php @@ -8,5 +8,6 @@ readonly class DeleteCbz implements CommandInterface { public function __construct( public string $chapterId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/DeleteChapter.php b/src/Domain/Manga/Application/Command/DeleteChapter.php index 58079b4..46f8acf 100644 --- a/src/Domain/Manga/Application/Command/DeleteChapter.php +++ b/src/Domain/Manga/Application/Command/DeleteChapter.php @@ -8,5 +8,6 @@ readonly class DeleteChapter implements CommandInterface { public function __construct( public string $chapterId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/DeleteManga.php b/src/Domain/Manga/Application/Command/DeleteManga.php index a97eeb5..3e3912f 100644 --- a/src/Domain/Manga/Application/Command/DeleteManga.php +++ b/src/Domain/Manga/Application/Command/DeleteManga.php @@ -8,5 +8,6 @@ readonly class DeleteManga implements CommandInterface { public function __construct( public string $mangaId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/EditManga.php b/src/Domain/Manga/Application/Command/EditManga.php index 2fb009d..41a4608 100644 --- a/src/Domain/Manga/Application/Command/EditManga.php +++ b/src/Domain/Manga/Application/Command/EditManga.php @@ -14,5 +14,6 @@ readonly class EditManga public ?string $status = null, public ?float $rating = null, public ?array $alternativeSlugs = null - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/EditMultipleChapters.php b/src/Domain/Manga/Application/Command/EditMultipleChapters.php index 76506b8..2cdf80b 100644 --- a/src/Domain/Manga/Application/Command/EditMultipleChapters.php +++ b/src/Domain/Manga/Application/Command/EditMultipleChapters.php @@ -9,5 +9,6 @@ readonly class EditMultipleChapters */ public function __construct( public array $chapters - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/FetchMangaChapters.php b/src/Domain/Manga/Application/Command/FetchMangaChapters.php index 26c8d55..bbfe31c 100644 --- a/src/Domain/Manga/Application/Command/FetchMangaChapters.php +++ b/src/Domain/Manga/Application/Command/FetchMangaChapters.php @@ -8,5 +8,6 @@ readonly class FetchMangaChapters { public function __construct( public MangaId $mangaId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/ImportChapter.php b/src/Domain/Manga/Application/Command/ImportChapter.php index 5798df6..cfc4ca8 100644 --- a/src/Domain/Manga/Application/Command/ImportChapter.php +++ b/src/Domain/Manga/Application/Command/ImportChapter.php @@ -8,5 +8,6 @@ readonly class ImportChapter public string $mangaId, public float $chapterNumber, public string $fileBinary - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/ImportVolume.php b/src/Domain/Manga/Application/Command/ImportVolume.php index 52f8745..424e616 100644 --- a/src/Domain/Manga/Application/Command/ImportVolume.php +++ b/src/Domain/Manga/Application/Command/ImportVolume.php @@ -8,9 +8,6 @@ readonly class ImportVolume public string $mangaId, public int $volumeNumber, public string $fileBinary - ) {} + ) { + } } - - - - diff --git a/src/Domain/Manga/Application/Command/RefreshMangaChapters.php b/src/Domain/Manga/Application/Command/RefreshMangaChapters.php index 869d738..c99f3c9 100644 --- a/src/Domain/Manga/Application/Command/RefreshMangaChapters.php +++ b/src/Domain/Manga/Application/Command/RefreshMangaChapters.php @@ -8,5 +8,6 @@ readonly class RefreshMangaChapters { public function __construct( public MangaId $mangaId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Command/ToggleMangaMonitoring.php b/src/Domain/Manga/Application/Command/ToggleMangaMonitoring.php index c06be85..3aa44bf 100644 --- a/src/Domain/Manga/Application/Command/ToggleMangaMonitoring.php +++ b/src/Domain/Manga/Application/Command/ToggleMangaMonitoring.php @@ -9,5 +9,6 @@ readonly class ToggleMangaMonitoring public function __construct( public MangaId $mangaId, public bool $enabled - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/CommandHandler/CheckMonitoredMangasHandler.php b/src/Domain/Manga/Application/CommandHandler/CheckMonitoredMangasHandler.php index b2cbca0..35bdfbd 100644 --- a/src/Domain/Manga/Application/CommandHandler/CheckMonitoredMangasHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/CheckMonitoredMangasHandler.php @@ -14,7 +14,8 @@ readonly class CheckMonitoredMangasHandler public function __construct( private MangaRepositoryInterface $mangaRepository, private MessageBusInterface $commandBus - ) {} + ) { + } public function handle(CheckMonitoredMangas $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/CreateMangaFromMangadexHandler.php b/src/Domain/Manga/Application/CommandHandler/CreateMangaFromMangadexHandler.php index e8b4fb7..6d4f7f1 100644 --- a/src/Domain/Manga/Application/CommandHandler/CreateMangaFromMangadexHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/CreateMangaFromMangadexHandler.php @@ -20,7 +20,8 @@ readonly class CreateMangaFromMangadexHandler private MangaRepositoryInterface $mangaRepository, private ImageProcessorInterface $imageProcessor, private EventDispatcherInterface $eventDispatcher - ) {} + ) { + } public function handle(CreateMangaFromMangadex $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/CreateMangaHandler.php b/src/Domain/Manga/Application/CommandHandler/CreateMangaHandler.php index d83cf65..74f5e8f 100644 --- a/src/Domain/Manga/Application/CommandHandler/CreateMangaHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/CreateMangaHandler.php @@ -21,7 +21,8 @@ readonly class CreateMangaHandler private MangaRepositoryInterface $mangaRepository, private ImageProcessorInterface $imageProcessor, private MessageBusInterface $messageBus - ) {} + ) { + } public function handle(CreateManga $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/DeleteCbzHandler.php b/src/Domain/Manga/Application/CommandHandler/DeleteCbzHandler.php index cf656ec..7edc983 100644 --- a/src/Domain/Manga/Application/CommandHandler/DeleteCbzHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/DeleteCbzHandler.php @@ -17,7 +17,8 @@ readonly class DeleteCbzHandler implements CommandHandlerInterface public function __construct( private ChapterRepositoryInterface $chapterRepository, private FileServiceInterface $fileService - ) {} + ) { + } public function handle(CommandInterface $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/DeleteChapterHandler.php b/src/Domain/Manga/Application/CommandHandler/DeleteChapterHandler.php index 4a96ea7..33d3f47 100644 --- a/src/Domain/Manga/Application/CommandHandler/DeleteChapterHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/DeleteChapterHandler.php @@ -14,7 +14,8 @@ readonly class DeleteChapterHandler implements CommandHandlerInterface { public function __construct( private ChapterRepositoryInterface $chapterRepository - ) {} + ) { + } public function handle(CommandInterface $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/DeleteMangaHandler.php b/src/Domain/Manga/Application/CommandHandler/DeleteMangaHandler.php index 8dfe60f..521b08a 100644 --- a/src/Domain/Manga/Application/CommandHandler/DeleteMangaHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/DeleteMangaHandler.php @@ -12,7 +12,8 @@ readonly class DeleteMangaHandler implements CommandHandlerInterface { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(CommandInterface $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/EditMangaHandler.php b/src/Domain/Manga/Application/CommandHandler/EditMangaHandler.php index 3a194e5..b6004c4 100644 --- a/src/Domain/Manga/Application/CommandHandler/EditMangaHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/EditMangaHandler.php @@ -11,7 +11,8 @@ readonly class EditMangaHandler { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(EditManga $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/EditMultipleChaptersHandler.php b/src/Domain/Manga/Application/CommandHandler/EditMultipleChaptersHandler.php index 5812b15..91ad939 100644 --- a/src/Domain/Manga/Application/CommandHandler/EditMultipleChaptersHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/EditMultipleChaptersHandler.php @@ -10,7 +10,8 @@ readonly class EditMultipleChaptersHandler { public function __construct( private ChapterRepositoryInterface $chapterRepository - ) {} + ) { + } public function handle(EditMultipleChapters $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/FetchMangaChaptersHandler.php b/src/Domain/Manga/Application/CommandHandler/FetchMangaChaptersHandler.php index 2a12cc1..5118c18 100644 --- a/src/Domain/Manga/Application/CommandHandler/FetchMangaChaptersHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/FetchMangaChaptersHandler.php @@ -13,7 +13,8 @@ readonly class FetchMangaChaptersHandler public function __construct( private MangaRepositoryInterface $mangaRepository, private ChapterSynchronizationServiceInterface $chapterSynchronizationService - ) {} + ) { + } public function handle(FetchMangaChapters $command): void { @@ -23,7 +24,7 @@ readonly class FetchMangaChaptersHandler throw new MangaNotFoundException(); } - if($manga->getExternalId() === null){ + if ($manga->getExternalId() === null) { throw new MangadexApiException("Manga has no external_id"); } diff --git a/src/Domain/Manga/Application/CommandHandler/ImportChapterHandler.php b/src/Domain/Manga/Application/CommandHandler/ImportChapterHandler.php index 08e2be8..3be6d36 100644 --- a/src/Domain/Manga/Application/CommandHandler/ImportChapterHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/ImportChapterHandler.php @@ -18,7 +18,8 @@ readonly class ImportChapterHandler private MangaRepositoryInterface $mangaRepository, private ChapterRepositoryInterface $chapterRepository, private MangaPathManagerInterface $pathManager - ) {} + ) { + } public function handle(ImportChapter $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/ImportVolumeHandler.php b/src/Domain/Manga/Application/CommandHandler/ImportVolumeHandler.php index 404755d..b8c4677 100644 --- a/src/Domain/Manga/Application/CommandHandler/ImportVolumeHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/ImportVolumeHandler.php @@ -16,7 +16,8 @@ readonly class ImportVolumeHandler private MangaRepositoryInterface $mangaRepository, private ChapterRepositoryInterface $chapterRepository, private MangaPathManagerInterface $pathManager - ) {} + ) { + } public function handle(ImportVolume $command): void { @@ -93,7 +94,3 @@ readonly class ImportVolumeHandler return $cbzPath; } } - - - - diff --git a/src/Domain/Manga/Application/CommandHandler/RefreshMangaChaptersHandler.php b/src/Domain/Manga/Application/CommandHandler/RefreshMangaChaptersHandler.php index d6b5ab5..c5b4751 100644 --- a/src/Domain/Manga/Application/CommandHandler/RefreshMangaChaptersHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/RefreshMangaChaptersHandler.php @@ -16,7 +16,8 @@ readonly class RefreshMangaChaptersHandler private MangaRepositoryInterface $mangaRepository, private ChapterSynchronizationServiceInterface $chapterSynchronizationService, private MessageBusInterface $eventBus - ) {} + ) { + } public function handle(RefreshMangaChapters $command): void { diff --git a/src/Domain/Manga/Application/CommandHandler/ToggleMangaMonitoringHandler.php b/src/Domain/Manga/Application/CommandHandler/ToggleMangaMonitoringHandler.php index 72f0bac..f0c3cc1 100644 --- a/src/Domain/Manga/Application/CommandHandler/ToggleMangaMonitoringHandler.php +++ b/src/Domain/Manga/Application/CommandHandler/ToggleMangaMonitoringHandler.php @@ -10,7 +10,8 @@ readonly class ToggleMangaMonitoringHandler { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(ToggleMangaMonitoring $command): void { diff --git a/src/Domain/Manga/Application/EventListener/ChapterImportedEventListener.php b/src/Domain/Manga/Application/EventListener/ChapterImportedEventListener.php index 39e2d22..b8cd58d 100644 --- a/src/Domain/Manga/Application/EventListener/ChapterImportedEventListener.php +++ b/src/Domain/Manga/Application/EventListener/ChapterImportedEventListener.php @@ -16,7 +16,8 @@ readonly class ChapterImportedEventListener public function __construct( private MangaRepositoryInterface $mangaRepository, private ChapterRepositoryInterface $chapterRepository, - ) {} + ) { + } public function __invoke(ChapterImported $event): void { @@ -44,5 +45,3 @@ readonly class ChapterImportedEventListener } } } - - diff --git a/src/Domain/Manga/Application/EventListener/MangaCreatedEventListener.php b/src/Domain/Manga/Application/EventListener/MangaCreatedEventListener.php index bc20e4e..7a5d85d 100644 --- a/src/Domain/Manga/Application/EventListener/MangaCreatedEventListener.php +++ b/src/Domain/Manga/Application/EventListener/MangaCreatedEventListener.php @@ -11,7 +11,8 @@ readonly class MangaCreatedEventListener { public function __construct( private FetchMangaChaptersHandler $fetchMangaChaptersHandler - ) {} + ) { + } public function __invoke(MangaCreated $event): void { diff --git a/src/Domain/Manga/Application/EventListener/VolumeImportedEventListener.php b/src/Domain/Manga/Application/EventListener/VolumeImportedEventListener.php index 6ed8923..e3aec66 100644 --- a/src/Domain/Manga/Application/EventListener/VolumeImportedEventListener.php +++ b/src/Domain/Manga/Application/EventListener/VolumeImportedEventListener.php @@ -16,7 +16,8 @@ readonly class VolumeImportedEventListener public function __construct( private MangaRepositoryInterface $mangaRepository, private ChapterRepositoryInterface $chapterRepository, - ) {} + ) { + } public function __invoke(VolumeImported $event): void { @@ -45,5 +46,3 @@ readonly class VolumeImportedEventListener } } } - - diff --git a/src/Domain/Manga/Application/Query/DownloadCbz.php b/src/Domain/Manga/Application/Query/DownloadCbz.php index 75ebeba..fa93b1e 100644 --- a/src/Domain/Manga/Application/Query/DownloadCbz.php +++ b/src/Domain/Manga/Application/Query/DownloadCbz.php @@ -8,5 +8,6 @@ readonly class DownloadCbz implements QueryInterface { public function __construct( public string $chapterId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Query/DownloadVolume.php b/src/Domain/Manga/Application/Query/DownloadVolume.php index dc9d6f4..05d7df8 100644 --- a/src/Domain/Manga/Application/Query/DownloadVolume.php +++ b/src/Domain/Manga/Application/Query/DownloadVolume.php @@ -9,5 +9,6 @@ readonly class DownloadVolume implements QueryInterface public function __construct( public string $mangaId, public int $volume - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Query/FindMangaMatchByFilename.php b/src/Domain/Manga/Application/Query/FindMangaMatchByFilename.php index 4470f57..f922747 100644 --- a/src/Domain/Manga/Application/Query/FindMangaMatchByFilename.php +++ b/src/Domain/Manga/Application/Query/FindMangaMatchByFilename.php @@ -11,4 +11,3 @@ readonly class FindMangaMatchByFilename ) { } } - diff --git a/src/Domain/Manga/Application/Query/GetMangaById.php b/src/Domain/Manga/Application/Query/GetMangaById.php index 47d5a8c..a8ee3e4 100644 --- a/src/Domain/Manga/Application/Query/GetMangaById.php +++ b/src/Domain/Manga/Application/Query/GetMangaById.php @@ -6,5 +6,6 @@ readonly class GetMangaById { public function __construct( public string $id - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Query/GetMangaBySlug.php b/src/Domain/Manga/Application/Query/GetMangaBySlug.php index 64292b2..fe90776 100644 --- a/src/Domain/Manga/Application/Query/GetMangaBySlug.php +++ b/src/Domain/Manga/Application/Query/GetMangaBySlug.php @@ -6,5 +6,6 @@ readonly class GetMangaBySlug { public function __construct( public string $slug - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/Query/GetMangaChapters.php b/src/Domain/Manga/Application/Query/GetMangaChapters.php index 9820d14..eab76fe 100644 --- a/src/Domain/Manga/Application/Query/GetMangaChapters.php +++ b/src/Domain/Manga/Application/Query/GetMangaChapters.php @@ -9,5 +9,6 @@ readonly class GetMangaChapters public ?int $page = 1, public ?int $limit = 20, public ?string $sortOrder = 'desc' - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/Query/GetMangaList.php b/src/Domain/Manga/Application/Query/GetMangaList.php index a656da5..b4b7494 100644 --- a/src/Domain/Manga/Application/Query/GetMangaList.php +++ b/src/Domain/Manga/Application/Query/GetMangaList.php @@ -9,5 +9,6 @@ readonly class GetMangaList public ?int $limit = 20, public ?string $sortBy = 'title', public ?string $sortOrder = 'asc' - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/Query/MonitoringCriteria.php b/src/Domain/Manga/Application/Query/MonitoringCriteria.php index 6bfc824..0105fa3 100644 --- a/src/Domain/Manga/Application/Query/MonitoringCriteria.php +++ b/src/Domain/Manga/Application/Query/MonitoringCriteria.php @@ -9,5 +9,6 @@ readonly class MonitoringCriteria public function __construct( public bool $enabled, public ?DateTimeImmutable $lastCheckBefore = null - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Query/SearchLocalManga.php b/src/Domain/Manga/Application/Query/SearchLocalManga.php index 21f33b7..7bd0cf7 100644 --- a/src/Domain/Manga/Application/Query/SearchLocalManga.php +++ b/src/Domain/Manga/Application/Query/SearchLocalManga.php @@ -10,4 +10,4 @@ readonly class SearchLocalManga public int $limit = 20 ) { } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/Query/SearchManga.php b/src/Domain/Manga/Application/Query/SearchManga.php index 12b6388..6670252 100644 --- a/src/Domain/Manga/Application/Query/SearchManga.php +++ b/src/Domain/Manga/Application/Query/SearchManga.php @@ -6,5 +6,6 @@ readonly class SearchManga { public function __construct( public string $title - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/QueryHandler/DownloadCbzHandler.php b/src/Domain/Manga/Application/QueryHandler/DownloadCbzHandler.php index a4f92e2..d7043d5 100644 --- a/src/Domain/Manga/Application/QueryHandler/DownloadCbzHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/DownloadCbzHandler.php @@ -18,7 +18,8 @@ readonly class DownloadCbzHandler implements QueryHandlerInterface public function __construct( private ChapterRepositoryInterface $chapterRepository, private FileServiceInterface $fileService - ) {} + ) { + } public function handle(QueryInterface $query): ResponseInterface { diff --git a/src/Domain/Manga/Application/QueryHandler/DownloadVolumeHandler.php b/src/Domain/Manga/Application/QueryHandler/DownloadVolumeHandler.php index 47f236e..c4a5855 100644 --- a/src/Domain/Manga/Application/QueryHandler/DownloadVolumeHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/DownloadVolumeHandler.php @@ -19,7 +19,8 @@ readonly class DownloadVolumeHandler implements QueryHandlerInterface private ChapterRepositoryInterface $chapterRepository, private MangaRepositoryInterface $mangaRepository, private FileServiceInterface $fileService - ) {} + ) { + } public function handle(QueryInterface $query): ResponseInterface { @@ -46,7 +47,8 @@ readonly class DownloadVolumeHandler implements QueryHandlerInterface $cbzPaths[] = $chapter->getCbzPath(); } - $volumeName = sprintf('%s_vol%d', + $volumeName = sprintf( + '%s_vol%d', $manga->getSlug()->getValue(), $query->volume ); diff --git a/src/Domain/Manga/Application/QueryHandler/FindMangaMatchByFilenameHandler.php b/src/Domain/Manga/Application/QueryHandler/FindMangaMatchByFilenameHandler.php index bb93804..3d4e36a 100644 --- a/src/Domain/Manga/Application/QueryHandler/FindMangaMatchByFilenameHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/FindMangaMatchByFilenameHandler.php @@ -58,7 +58,7 @@ readonly class FindMangaMatchByFilenameHandler } // Trier les résultats par score de correspondance (du plus élevé au plus faible) - usort($matches, fn($a, $b) => $b->matchScore <=> $a->matchScore); + usort($matches, fn ($a, $b) => $b->matchScore <=> $a->matchScore); return new MangaMatchResponse( matches: $matches, @@ -119,4 +119,3 @@ readonly class FindMangaMatchByFilenameHandler return $score; } } - diff --git a/src/Domain/Manga/Application/QueryHandler/GetMangaByIdHandler.php b/src/Domain/Manga/Application/QueryHandler/GetMangaByIdHandler.php index bd24ac7..6f0d2d3 100644 --- a/src/Domain/Manga/Application/QueryHandler/GetMangaByIdHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/GetMangaByIdHandler.php @@ -11,7 +11,8 @@ readonly class GetMangaByIdHandler { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(GetMangaById $query): MangaResponse { diff --git a/src/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandler.php b/src/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandler.php index 70dab0f..407e06c 100644 --- a/src/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandler.php @@ -12,7 +12,8 @@ readonly class GetMangaBySlugHandler { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(GetMangaBySlug $query): MangaResponse { diff --git a/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php b/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php index b9e1ed4..9b88438 100644 --- a/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php @@ -8,11 +8,13 @@ use App\Domain\Manga\Application\Response\ChapterResponse; use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface; use App\Domain\Manga\Domain\Exception\MangaNotFoundException; use App\Domain\Manga\Domain\Model\Chapter; + readonly class GetMangaChaptersHandler { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(GetMangaChapters $query): ChapterListResponse { @@ -48,4 +50,4 @@ readonly class GetMangaChaptersHandler limit: $query->limit ); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/QueryHandler/GetMangaListHandler.php b/src/Domain/Manga/Application/QueryHandler/GetMangaListHandler.php index 9f35d79..2af8af9 100644 --- a/src/Domain/Manga/Application/QueryHandler/GetMangaListHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/GetMangaListHandler.php @@ -10,7 +10,8 @@ readonly class GetMangaListHandler { public function __construct( private MangaRepositoryInterface $mangaRepository - ) {} + ) { + } public function handle(GetMangaList $query): MangaListResponse { @@ -30,4 +31,4 @@ readonly class GetMangaListHandler limit: $query->limit ); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/QueryHandler/SearchLocalMangaHandler.php b/src/Domain/Manga/Application/QueryHandler/SearchLocalMangaHandler.php index 9d33a42..281d632 100644 --- a/src/Domain/Manga/Application/QueryHandler/SearchLocalMangaHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/SearchLocalMangaHandler.php @@ -12,7 +12,8 @@ readonly class SearchLocalMangaHandler { public function __construct( private MangaRepositoryInterface $repository - ) {} + ) { + } public function handle(SearchLocalManga $query): MangaListResponse { diff --git a/src/Domain/Manga/Application/QueryHandler/SearchMangaHandler.php b/src/Domain/Manga/Application/QueryHandler/SearchMangaHandler.php index 35e49ba..69b35fd 100644 --- a/src/Domain/Manga/Application/QueryHandler/SearchMangaHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/SearchMangaHandler.php @@ -12,7 +12,8 @@ readonly class SearchMangaHandler { public function __construct( private MangaProviderInterface $mangaProvider - ) {} + ) { + } public function handle(SearchManga $query): MangaSearchResponse { @@ -40,4 +41,4 @@ readonly class SearchMangaHandler ) ); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/Response/ChapterListResponse.php b/src/Domain/Manga/Application/Response/ChapterListResponse.php index c5cb73a..3172e82 100644 --- a/src/Domain/Manga/Application/Response/ChapterListResponse.php +++ b/src/Domain/Manga/Application/Response/ChapterListResponse.php @@ -9,7 +9,8 @@ readonly class ChapterListResponse public int $total, public int $page, public int $limit - ) {} + ) { + } public function getTotalPages(): int { @@ -25,4 +26,4 @@ readonly class ChapterListResponse { return $this->page > 1; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/Response/ChapterResponse.php b/src/Domain/Manga/Application/Response/ChapterResponse.php index 3fad1eb..7a9dced 100644 --- a/src/Domain/Manga/Application/Response/ChapterResponse.php +++ b/src/Domain/Manga/Application/Response/ChapterResponse.php @@ -12,5 +12,6 @@ readonly class ChapterResponse public bool $isVisible, public ?string $cbzPath, public \DateTimeImmutable $createdAt - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Application/Response/DownloadResponse.php b/src/Domain/Manga/Application/Response/DownloadResponse.php index 30b7f1b..f83274a 100644 --- a/src/Domain/Manga/Application/Response/DownloadResponse.php +++ b/src/Domain/Manga/Application/Response/DownloadResponse.php @@ -9,5 +9,6 @@ readonly class DownloadResponse implements ResponseInterface { public function __construct( public Response $httpResponse - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Response/MangaListResponse.php b/src/Domain/Manga/Application/Response/MangaListResponse.php index 07c6cfe..26eec50 100644 --- a/src/Domain/Manga/Application/Response/MangaListResponse.php +++ b/src/Domain/Manga/Application/Response/MangaListResponse.php @@ -9,7 +9,8 @@ readonly class MangaListResponse public int $total, public int $page, public int $limit - ) {} + ) { + } public function getTotalPages(): int { @@ -25,4 +26,4 @@ readonly class MangaListResponse { return $this->page > 1; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/Response/MangaMatchItem.php b/src/Domain/Manga/Application/Response/MangaMatchItem.php index c010859..b47b1ac 100644 --- a/src/Domain/Manga/Application/Response/MangaMatchItem.php +++ b/src/Domain/Manga/Application/Response/MangaMatchItem.php @@ -18,4 +18,3 @@ readonly class MangaMatchItem ) { } } - diff --git a/src/Domain/Manga/Application/Response/MangaMatchResponse.php b/src/Domain/Manga/Application/Response/MangaMatchResponse.php index 585910b..3314987 100644 --- a/src/Domain/Manga/Application/Response/MangaMatchResponse.php +++ b/src/Domain/Manga/Application/Response/MangaMatchResponse.php @@ -27,4 +27,3 @@ readonly class MangaMatchResponse return $this->matches[0] ?? null; } } - diff --git a/src/Domain/Manga/Application/Response/MangaResponse.php b/src/Domain/Manga/Application/Response/MangaResponse.php index 144f51f..3c7314e 100644 --- a/src/Domain/Manga/Application/Response/MangaResponse.php +++ b/src/Domain/Manga/Application/Response/MangaResponse.php @@ -19,5 +19,6 @@ readonly class MangaResponse public ?string $thumbnailUrl, public ?float $rating, public bool $monitored - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Response/MangaSearchItem.php b/src/Domain/Manga/Application/Response/MangaSearchItem.php index 07dc4fc..a21c2ee 100644 --- a/src/Domain/Manga/Application/Response/MangaSearchItem.php +++ b/src/Domain/Manga/Application/Response/MangaSearchItem.php @@ -17,5 +17,6 @@ readonly class MangaSearchItem public ?string $imageUrl, public ?string $thumbnailUrl, public ?float $rating - ) {} + ) { + } } diff --git a/src/Domain/Manga/Application/Response/MangaSearchResponse.php b/src/Domain/Manga/Application/Response/MangaSearchResponse.php index 58e9b16..dd466fd 100644 --- a/src/Domain/Manga/Application/Response/MangaSearchResponse.php +++ b/src/Domain/Manga/Application/Response/MangaSearchResponse.php @@ -14,4 +14,4 @@ readonly class MangaSearchResponse { $this->items = $items; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Application/Response/SearchLocalMangaResponse.php b/src/Domain/Manga/Application/Response/SearchLocalMangaResponse.php index 7677069..1af9fb9 100644 --- a/src/Domain/Manga/Application/Response/SearchLocalMangaResponse.php +++ b/src/Domain/Manga/Application/Response/SearchLocalMangaResponse.php @@ -12,7 +12,8 @@ readonly class SearchLocalMangaResponse public int $total, public int $page, public int $limit - ) {} + ) { + } public function hasNextPage(): bool { @@ -23,4 +24,4 @@ readonly class SearchLocalMangaResponse { return $this->page > 1; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Contract/Client/MangadexClientInterface.php b/src/Domain/Manga/Domain/Contract/Client/MangadexClientInterface.php index 328dfe9..acd9696 100644 --- a/src/Domain/Manga/Domain/Contract/Client/MangadexClientInterface.php +++ b/src/Domain/Manga/Domain/Contract/Client/MangadexClientInterface.php @@ -93,4 +93,4 @@ interface MangadexClientInterface * } */ public function getManga(string $mangaId): array; -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Contract/Provider/MangaProviderInterface.php b/src/Domain/Manga/Domain/Contract/Provider/MangaProviderInterface.php index 4565309..937769b 100644 --- a/src/Domain/Manga/Domain/Contract/Provider/MangaProviderInterface.php +++ b/src/Domain/Manga/Domain/Contract/Provider/MangaProviderInterface.php @@ -9,6 +9,6 @@ use App\Domain\Manga\Domain\Model\ValueObject\ExternalId; interface MangaProviderInterface { public function search(string $title): MangaCollection; - + public function findByExternalId(ExternalId $externalId): ?Manga; -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Contract/Service/ImageProcessorInterface.php b/src/Domain/Manga/Domain/Contract/Service/ImageProcessorInterface.php index ee6b080..625de0b 100644 --- a/src/Domain/Manga/Domain/Contract/Service/ImageProcessorInterface.php +++ b/src/Domain/Manga/Domain/Contract/Service/ImageProcessorInterface.php @@ -13,4 +13,4 @@ interface ImageProcessorInterface * @throws \Exception */ public function createThumbnail(string $originalImagePath): string; -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Event/ChapterReadyForScraping.php b/src/Domain/Manga/Domain/Event/ChapterReadyForScraping.php index 3444d94..fc627df 100644 --- a/src/Domain/Manga/Domain/Event/ChapterReadyForScraping.php +++ b/src/Domain/Manga/Domain/Event/ChapterReadyForScraping.php @@ -8,5 +8,6 @@ readonly class ChapterReadyForScraping { public function __construct( public ChapterId $chapterId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Domain/Event/MangaCreated.php b/src/Domain/Manga/Domain/Event/MangaCreated.php index 449f7dc..e713be2 100644 --- a/src/Domain/Manga/Domain/Event/MangaCreated.php +++ b/src/Domain/Manga/Domain/Event/MangaCreated.php @@ -7,5 +7,6 @@ readonly class MangaCreated public function __construct( public string $mangaId, public string $externalId - ) {} + ) { + } } diff --git a/src/Domain/Manga/Domain/Exception/InvalidExternalIdException.php b/src/Domain/Manga/Domain/Exception/InvalidExternalIdException.php index 9089395..32c0255 100644 --- a/src/Domain/Manga/Domain/Exception/InvalidExternalIdException.php +++ b/src/Domain/Manga/Domain/Exception/InvalidExternalIdException.php @@ -4,4 +4,4 @@ namespace App\Domain\Manga\Domain\Exception; class InvalidExternalIdException extends MangaDomainException { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Exception/InvalidMangaIdException.php b/src/Domain/Manga/Domain/Exception/InvalidMangaIdException.php index ac10357..ff272a9 100644 --- a/src/Domain/Manga/Domain/Exception/InvalidMangaIdException.php +++ b/src/Domain/Manga/Domain/Exception/InvalidMangaIdException.php @@ -4,4 +4,4 @@ namespace App\Domain\Manga\Domain\Exception; class InvalidMangaIdException extends MangaDomainException { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Exception/InvalidMangaSlugException.php b/src/Domain/Manga/Domain/Exception/InvalidMangaSlugException.php index 3c83582..ff6a9ac 100644 --- a/src/Domain/Manga/Domain/Exception/InvalidMangaSlugException.php +++ b/src/Domain/Manga/Domain/Exception/InvalidMangaSlugException.php @@ -4,4 +4,4 @@ namespace App\Domain\Manga\Domain\Exception; class InvalidMangaSlugException extends MangaDomainException { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Exception/InvalidMangaTitleException.php b/src/Domain/Manga/Domain/Exception/InvalidMangaTitleException.php index 4d68ad9..2e79043 100644 --- a/src/Domain/Manga/Domain/Exception/InvalidMangaTitleException.php +++ b/src/Domain/Manga/Domain/Exception/InvalidMangaTitleException.php @@ -4,4 +4,4 @@ namespace App\Domain\Manga\Domain\Exception; class InvalidMangaTitleException extends MangaDomainException { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Exception/MangadexApiException.php b/src/Domain/Manga/Domain/Exception/MangadexApiException.php index 23903c0..080902b 100644 --- a/src/Domain/Manga/Domain/Exception/MangadexApiException.php +++ b/src/Domain/Manga/Domain/Exception/MangadexApiException.php @@ -8,4 +8,4 @@ class MangadexApiException extends MangaDomainException { parent::__construct($message, 0, $previous); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Exception/MangadexAuthenticationException.php b/src/Domain/Manga/Domain/Exception/MangadexAuthenticationException.php index ea3b0a5..561e0a1 100644 --- a/src/Domain/Manga/Domain/Exception/MangadexAuthenticationException.php +++ b/src/Domain/Manga/Domain/Exception/MangadexAuthenticationException.php @@ -8,4 +8,4 @@ class MangadexAuthenticationException extends MangaDomainException { parent::__construct($message, 0, $previous); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/AnalyzedFilename.php b/src/Domain/Manga/Domain/Model/AnalyzedFilename.php index 4639b6f..83d64cb 100644 --- a/src/Domain/Manga/Domain/Model/AnalyzedFilename.php +++ b/src/Domain/Manga/Domain/Model/AnalyzedFilename.php @@ -42,4 +42,3 @@ readonly class AnalyzedFilename return $this->volumeNumber !== null; } } - diff --git a/src/Domain/Manga/Domain/Model/Chapter.php b/src/Domain/Manga/Domain/Model/Chapter.php index a5b9e60..d6ae514 100644 --- a/src/Domain/Manga/Domain/Model/Chapter.php +++ b/src/Domain/Manga/Domain/Model/Chapter.php @@ -15,7 +15,8 @@ readonly class Chapter private bool $isVisible, private ?string $cbzPath = null, private \DateTimeImmutable $createdAt = new \DateTimeImmutable() - ) {} + ) { + } public function getId(): string { diff --git a/src/Domain/Manga/Domain/Model/MangaCollection.php b/src/Domain/Manga/Domain/Model/MangaCollection.php index 28763f6..6a2f1ff 100644 --- a/src/Domain/Manga/Domain/Model/MangaCollection.php +++ b/src/Domain/Manga/Domain/Model/MangaCollection.php @@ -24,4 +24,4 @@ readonly class MangaCollection { return count($this->items); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/ValueObject/ChapterId.php b/src/Domain/Manga/Domain/Model/ValueObject/ChapterId.php index 128bf12..d9199de 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/ChapterId.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/ChapterId.php @@ -6,7 +6,8 @@ readonly class ChapterId { public function __construct( private string $value - ) {} + ) { + } public function getValue(): string { diff --git a/src/Domain/Manga/Domain/Model/ValueObject/ChapterNumber.php b/src/Domain/Manga/Domain/Model/ValueObject/ChapterNumber.php index 0a6056e..1c116cc 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/ChapterNumber.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/ChapterNumber.php @@ -21,4 +21,3 @@ readonly class ChapterNumber return $this->value; } } - diff --git a/src/Domain/Manga/Domain/Model/ValueObject/ExternalId.php b/src/Domain/Manga/Domain/Model/ValueObject/ExternalId.php index b487c7d..6d059b1 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/ExternalId.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/ExternalId.php @@ -18,4 +18,4 @@ readonly class ExternalId { return $this->value; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/ValueObject/ImageUrls.php b/src/Domain/Manga/Domain/Model/ValueObject/ImageUrls.php index 3bf1087..d69e78e 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/ImageUrls.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/ImageUrls.php @@ -7,7 +7,8 @@ readonly class ImageUrls public function __construct( private string $full, private string $thumbnail - ) {} + ) { + } public function getFull(): string { @@ -18,4 +19,4 @@ readonly class ImageUrls { return $this->thumbnail; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/ValueObject/MangaId.php b/src/Domain/Manga/Domain/Model/ValueObject/MangaId.php index 42a3a35..7568ab3 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/MangaId.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/MangaId.php @@ -23,4 +23,4 @@ readonly class MangaId { return $this->value === $other->value; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/ValueObject/MangaSlug.php b/src/Domain/Manga/Domain/Model/ValueObject/MangaSlug.php index 3c91c76..7597921 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/MangaSlug.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/MangaSlug.php @@ -22,4 +22,4 @@ readonly class MangaSlug { return $this->value; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/ValueObject/MangaTitle.php b/src/Domain/Manga/Domain/Model/ValueObject/MangaTitle.php index b6e3c39..70942de 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/MangaTitle.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/MangaTitle.php @@ -18,4 +18,4 @@ readonly class MangaTitle { return $this->value; } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Domain/Model/ValueObject/MonitoringStatus.php b/src/Domain/Manga/Domain/Model/ValueObject/MonitoringStatus.php index 1123a1c..9317ac0 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/MonitoringStatus.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/MonitoringStatus.php @@ -6,7 +6,8 @@ readonly class MonitoringStatus { public function __construct( private bool $enabled - ) {} + ) { + } public static function enabled(): self { diff --git a/src/Domain/Manga/Domain/Model/ValueObject/VolumeNumber.php b/src/Domain/Manga/Domain/Model/ValueObject/VolumeNumber.php index 5f848b2..10516e3 100644 --- a/src/Domain/Manga/Domain/Model/ValueObject/VolumeNumber.php +++ b/src/Domain/Manga/Domain/Model/ValueObject/VolumeNumber.php @@ -21,4 +21,3 @@ readonly class VolumeNumber return $this->value; } } - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportChapterController.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportChapterController.php index eedba05..686ec91 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportChapterController.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportChapterController.php @@ -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; } } - - - - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportVolumeController.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportVolumeController.php index d946e75..4f8073d 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportVolumeController.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Controller/ImportVolumeController.php @@ -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; } } - - - - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterCollection.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterCollection.php index 4c83b5f..bb47f0b 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterCollection.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterCollection.php @@ -12,5 +12,6 @@ readonly class ChapterCollection public int $limit, public bool $hasNextPage, public bool $hasPreviousPage - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterListItem.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterListItem.php index 0c4cd44..2e5715d 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterListItem.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/ChapterListItem.php @@ -15,5 +15,6 @@ readonly class ChapterListItem public bool $isVisible, public bool $isAvailable, public string $createdAt - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchCollection.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchCollection.php index 83f5c8e..dc5dbb2 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchCollection.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchCollection.php @@ -18,4 +18,3 @@ readonly class FilenameMatchCollection ) { } } - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchItem.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchItem.php index 6114270..80025ad 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchItem.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/FilenameMatchItem.php @@ -18,4 +18,3 @@ readonly class FilenameMatchItem ) { } } - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaCollection.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaCollection.php index 1b36ffc..bc6639c 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaCollection.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaCollection.php @@ -14,5 +14,6 @@ readonly class MangaCollection public int $limit, public bool $hasNextPage, public bool $hasPreviousPage - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaDetail.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaDetail.php index 8b62b9b..efa7fb7 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaDetail.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaDetail.php @@ -22,5 +22,6 @@ readonly class MangaDetail public ?string $thumbnailUrl, public ?float $rating, public bool $monitored - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaListItem.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaListItem.php index 1c3ea5d..91ae7ab 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaListItem.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaListItem.php @@ -21,5 +21,6 @@ readonly class MangaListItem public string $status, public ?float $rating, public DateTimeImmutable $createdAt, - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchCollection.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchCollection.php index a1fcf73..96b0f8f 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchCollection.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchCollection.php @@ -7,5 +7,6 @@ readonly class MangaSearchCollection public function __construct( /** @var MangaSearchItem[] */ public array $items - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchItem.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchItem.php index 3c5b275..fd2b955 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchItem.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Dto/MangaSearchItem.php @@ -19,5 +19,6 @@ readonly class MangaSearchItem public ?string $imageUrl, public ?string $thumbnailUrl, public ?float $rating - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/CreateMangaDirectlyResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/CreateMangaDirectlyResource.php index d33f7f3..3903fb0 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/CreateMangaDirectlyResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/CreateMangaDirectlyResource.php @@ -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; -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteCbzResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteCbzResource.php index 7cd3f28..cbd61f7 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteCbzResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteCbzResource.php @@ -45,5 +45,6 @@ class DeleteCbzResource { public function __construct( public string $id - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteChapterResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteChapterResource.php index d2931c0..735731d 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteChapterResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteChapterResource.php @@ -45,5 +45,6 @@ class DeleteChapterResource { public function __construct( public string $id - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteMangaResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteMangaResource.php index 9d2f2f6..c7eb556 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteMangaResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteMangaResource.php @@ -45,5 +45,6 @@ class DeleteMangaResource { public function __construct( public string $id - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadCbzResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadCbzResource.php index 9962748..dfc7a0b 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadCbzResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadCbzResource.php @@ -21,5 +21,6 @@ class DownloadCbzResource { public function __construct( public string $id - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadVolumeResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadVolumeResource.php index 0bd4d83..a922543 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadVolumeResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DownloadVolumeResource.php @@ -22,5 +22,6 @@ class DownloadVolumeResource public function __construct( public string $id, public int $volume - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/EditMultipleChaptersResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/EditMultipleChaptersResource.php index 25244b3..537dae1 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/EditMultipleChaptersResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/EditMultipleChaptersResource.php @@ -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 - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FetchMangaChaptersResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FetchMangaChaptersResource.php index caf0227..d17fd15 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FetchMangaChaptersResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FetchMangaChaptersResource.php @@ -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 - ) {} + ) { + } } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FindMangaMatchByFilenameResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FindMangaMatchByFilenameResource.php index 2af3b37..6e6fbdb 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FindMangaMatchByFilenameResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/FindMangaMatchByFilenameResource.php @@ -108,4 +108,3 @@ class FindMangaMatchByFilenameResource ) { } } - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/GetMangaBySlugResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/GetMangaBySlugResource.php index 6dddb31..43380ea 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/GetMangaBySlugResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/GetMangaBySlugResource.php @@ -22,5 +22,6 @@ class GetMangaBySlugResource { public function __construct( public string $slug - ) {} -} \ No newline at end of file + ) { + } +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportChapterResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportChapterResource.php index df23d23..7f6d639 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportChapterResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportChapterResource.php @@ -72,7 +72,3 @@ class ImportChapterResource public ?File $file = null; } - - - - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportVolumeResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportVolumeResource.php index 92f4aaa..cf3c865 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportVolumeResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/ImportVolumeResource.php @@ -72,7 +72,3 @@ class ImportVolumeResource public ?File $file = null; } - - - - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaChaptersResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaChaptersResource.php index 26908fc..89be042 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaChaptersResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaChaptersResource.php @@ -63,4 +63,4 @@ use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaChaptersS )] class MangaChaptersResource { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaListResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaListResource.php index fc1b6b3..04601ed 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaListResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaListResource.php @@ -20,4 +20,4 @@ use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaListState )] class MangaListResource { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaResource.php b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaResource.php index b796744..e1e504f 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaResource.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/MangaResource.php @@ -32,4 +32,4 @@ use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\GetMangaStateProv )] class MangaResource { -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaDirectlyProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaDirectlyProcessor.php index 05e5050..6e8a0a8 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaDirectlyProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaDirectlyProcessor.php @@ -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); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaProcessor.php index dd80355..bb6813c 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/CreateMangaProcessor.php @@ -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()); } } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteCbzProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteCbzProcessor.php index ae161ea..af5c985 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteCbzProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteCbzProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteChapterProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteChapterProcessor.php index 457ed31..2ebfcac 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteChapterProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteChapterProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteMangaProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteMangaProcessor.php index 93eb239..77defac 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteMangaProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/DeleteMangaProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMangaProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMangaProcessor.php index 8ce8ea0..be76584 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMangaProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMangaProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMultipleChaptersProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMultipleChaptersProcessor.php index 5df34d3..95c9957 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMultipleChaptersProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/EditMultipleChaptersProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/FetchMangaChaptersProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/FetchMangaChaptersProcessor.php index 842fefe..59dfe7b 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/FetchMangaChaptersProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/FetchMangaChaptersProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/RefreshMangaChaptersProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/RefreshMangaChaptersProcessor.php index 8296cfb..62a4683 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/RefreshMangaChaptersProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/RefreshMangaChaptersProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/ToggleMonitoringProcessor.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/ToggleMonitoringProcessor.php index 656e07f..6886073 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/ToggleMonitoringProcessor.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Processor/ToggleMonitoringProcessor.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteCbzProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteCbzProvider.php index c7b68cf..eee7d34 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteCbzProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteCbzProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteChapterProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteChapterProvider.php index 5609daa..fc80a07 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteChapterProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteChapterProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteMangaProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteMangaProvider.php index f440512..55198ec 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteMangaProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteMangaProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadCbzProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadCbzProvider.php index 12f809a..15f9e3c 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadCbzProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadCbzProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadVolumeProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadVolumeProvider.php index f5db167..83d9420 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadVolumeProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DownloadVolumeProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/FindMangaMatchByFilenameStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/FindMangaMatchByFilenameStateProvider.php index 9988bd9..2b4a49a 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/FindMangaMatchByFilenameStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/FindMangaMatchByFilenameStateProvider.php @@ -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 ); } } - diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaBySlugStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaBySlugStateProvider.php index ae6bce1..e67cfd1 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaBySlugStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaBySlugStateProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php index 9f88617..3a6fd0f 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php @@ -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) ); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaListStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaListStateProvider.php index 3a1e1ca..9e092fe 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaListStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaListStateProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaStateProvider.php index 80192ff..f3b3aad 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaStateProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchLocalMangaStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchLocalMangaStateProvider.php index 7c6268d..8e89cfb 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchLocalMangaStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchLocalMangaStateProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchMangaStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchMangaStateProvider.php index c0df5f6..8782462 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchMangaStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/SearchMangaStateProvider.php @@ -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 ) ); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/Client/MangadexClient.php b/src/Domain/Manga/Infrastructure/Client/MangadexClient.php index 7942199..e66ba6c 100644 --- a/src/Domain/Manga/Infrastructure/Client/MangadexClient.php +++ b/src/Domain/Manga/Infrastructure/Client/MangadexClient.php @@ -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 ); } } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyFetchMangaChaptersHandler.php b/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyFetchMangaChaptersHandler.php index 986cf4a..ebeedc9 100644 --- a/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyFetchMangaChaptersHandler.php +++ b/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyFetchMangaChaptersHandler.php @@ -11,10 +11,11 @@ readonly class SymfonyFetchMangaChaptersHandler { public function __construct( private FetchMangaChaptersHandler $handler - ) {} + ) { + } public function __invoke(FetchMangaChapters $command): void { $this->handler->handle($command); } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyRefreshMangaChaptersHandler.php b/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyRefreshMangaChaptersHandler.php index f29d6b6..d752d9a 100644 --- a/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyRefreshMangaChaptersHandler.php +++ b/src/Domain/Manga/Infrastructure/CommandHandler/SymfonyRefreshMangaChaptersHandler.php @@ -11,7 +11,8 @@ readonly class SymfonyRefreshMangaChaptersHandler { public function __construct( private RefreshMangaChaptersHandler $handler - ) {} + ) { + } public function __invoke(RefreshMangaChapters $command): void { diff --git a/src/Domain/Manga/Infrastructure/MessageHandler/ChapterImportedMessageHandler.php b/src/Domain/Manga/Infrastructure/MessageHandler/ChapterImportedMessageHandler.php index 47a655b..69d5dee 100644 --- a/src/Domain/Manga/Infrastructure/MessageHandler/ChapterImportedMessageHandler.php +++ b/src/Domain/Manga/Infrastructure/MessageHandler/ChapterImportedMessageHandler.php @@ -20,5 +20,3 @@ readonly class ChapterImportedMessageHandler $this->listener->__invoke($event); } } - - diff --git a/src/Domain/Manga/Infrastructure/MessageHandler/VolumeImportedMessageHandler.php b/src/Domain/Manga/Infrastructure/MessageHandler/VolumeImportedMessageHandler.php index a0ed72a..2caad29 100644 --- a/src/Domain/Manga/Infrastructure/MessageHandler/VolumeImportedMessageHandler.php +++ b/src/Domain/Manga/Infrastructure/MessageHandler/VolumeImportedMessageHandler.php @@ -20,5 +20,3 @@ readonly class VolumeImportedMessageHandler $this->listener->__invoke($event); } } - - diff --git a/src/Domain/Manga/Infrastructure/Persistence/LegacyMangaRepository.php b/src/Domain/Manga/Infrastructure/Persistence/LegacyMangaRepository.php index 8c01282..0e19d80 100644 --- a/src/Domain/Manga/Infrastructure/Persistence/LegacyMangaRepository.php +++ b/src/Domain/Manga/Infrastructure/Persistence/LegacyMangaRepository.php @@ -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; diff --git a/src/Domain/Manga/Infrastructure/Persistence/Repository/LegacyChapterRepository.php b/src/Domain/Manga/Infrastructure/Persistence/Repository/LegacyChapterRepository.php index 211eb26..34f8439 100644 --- a/src/Domain/Manga/Infrastructure/Persistence/Repository/LegacyChapterRepository.php +++ b/src/Domain/Manga/Infrastructure/Persistence/Repository/LegacyChapterRepository.php @@ -12,7 +12,8 @@ readonly class LegacyChapterRepository implements ChapterRepositoryInterface { public function __construct( private EntityManagerInterface $entityManager - ) {} + ) { + } public function findById(string $id): ?Chapter { diff --git a/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php b/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php index 374d68f..52e63dc 100644 --- a/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php +++ b/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/Scheduler/MonitoringSchedule.php b/src/Domain/Manga/Infrastructure/Scheduler/MonitoringSchedule.php index 787e115..d3d145b 100644 --- a/src/Domain/Manga/Infrastructure/Scheduler/MonitoringSchedule.php +++ b/src/Domain/Manga/Infrastructure/Scheduler/MonitoringSchedule.php @@ -15,7 +15,8 @@ class MonitoringSchedule implements ScheduleProviderInterface { public function __construct( private CacheInterface $cache - ) {} + ) { + } public function getSchedule(): Schedule { diff --git a/src/Domain/Manga/Infrastructure/Service/FileService.php b/src/Domain/Manga/Infrastructure/Service/FileService.php index 3a1b3b6..32d3834 100644 --- a/src/Domain/Manga/Infrastructure/Service/FileService.php +++ b/src/Domain/Manga/Infrastructure/Service/FileService.php @@ -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 { diff --git a/src/Domain/Manga/Infrastructure/Service/ImageProcessor.php b/src/Domain/Manga/Infrastructure/Service/ImageProcessor.php index 75e2eea..2bf5171 100644 --- a/src/Domain/Manga/Infrastructure/Service/ImageProcessor.php +++ b/src/Domain/Manga/Infrastructure/Service/ImageProcessor.php @@ -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 } } } -} \ No newline at end of file +} diff --git a/src/Domain/Manga/Infrastructure/Service/MangadxChapterSynchronizationService.php b/src/Domain/Manga/Infrastructure/Service/MangadxChapterSynchronizationService.php index 184dcfe..ced91e8 100644 --- a/src/Domain/Manga/Infrastructure/Service/MangadxChapterSynchronizationService.php +++ b/src/Domain/Manga/Infrastructure/Service/MangadxChapterSynchronizationService.php @@ -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(), diff --git a/src/Domain/Reader/Application/Query/GetChapterPage.php b/src/Domain/Reader/Application/Query/GetChapterPage.php index 3b3713d..3f23c86 100644 --- a/src/Domain/Reader/Application/Query/GetChapterPage.php +++ b/src/Domain/Reader/Application/Query/GetChapterPage.php @@ -21,4 +21,4 @@ final readonly class GetChapterPage { return $this->pageNumber; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Application/QueryHandler/GetChapterPageHandler.php b/src/Domain/Reader/Application/QueryHandler/GetChapterPageHandler.php index dc8efa0..75950a7 100644 --- a/src/Domain/Reader/Application/QueryHandler/GetChapterPageHandler.php +++ b/src/Domain/Reader/Application/QueryHandler/GetChapterPageHandler.php @@ -44,4 +44,4 @@ final readonly class GetChapterPageHandler $page->getDimensions() ); } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Application/Response/ChapterContextResponse.php b/src/Domain/Reader/Application/Response/ChapterContextResponse.php index 7cef999..480ebf0 100644 --- a/src/Domain/Reader/Application/Response/ChapterContextResponse.php +++ b/src/Domain/Reader/Application/Response/ChapterContextResponse.php @@ -13,8 +13,7 @@ final readonly class ChapterContextResponse private int $totalPages, private ?string $previousChapterId, private ?string $nextChapterId - ) - { + ) { } public function getId(): string diff --git a/src/Domain/Reader/Application/Response/ChapterPageResponse.php b/src/Domain/Reader/Application/Response/ChapterPageResponse.php index 90ee037..4e7b861 100644 --- a/src/Domain/Reader/Application/Response/ChapterPageResponse.php +++ b/src/Domain/Reader/Application/Response/ChapterPageResponse.php @@ -39,4 +39,4 @@ final readonly class ChapterPageResponse { return $this->dimensions; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Application/Response/ChapterPagesResponse.php b/src/Domain/Reader/Application/Response/ChapterPagesResponse.php index 6302e4a..6403d6b 100644 --- a/src/Domain/Reader/Application/Response/ChapterPagesResponse.php +++ b/src/Domain/Reader/Application/Response/ChapterPagesResponse.php @@ -55,4 +55,4 @@ final class ChapterPagesResponse { return (int) ceil($this->totalItems / $this->itemsPerPage); } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Application/Response/PageResponse.php b/src/Domain/Reader/Application/Response/PageResponse.php index a7bfa8d..b2d2140 100644 --- a/src/Domain/Reader/Application/Response/PageResponse.php +++ b/src/Domain/Reader/Application/Response/PageResponse.php @@ -40,4 +40,4 @@ final class PageResponse { return $this->dimensions; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/Contract/Repository/ChapterRepositoryInterface.php b/src/Domain/Reader/Domain/Contract/Repository/ChapterRepositoryInterface.php index d9c8fd4..c794501 100644 --- a/src/Domain/Reader/Domain/Contract/Repository/ChapterRepositoryInterface.php +++ b/src/Domain/Reader/Domain/Contract/Repository/ChapterRepositoryInterface.php @@ -16,14 +16,14 @@ interface ChapterRepositoryInterface * @return array */ public function getPagesForChapter(ChapterId $chapterId, int $page = 1, int $itemsPerPage = 20): array; - + public function getChapterContext(ChapterId $chapterId): ChapterContext; - + public function getTotalPagesForChapter(ChapterId $chapterId): int; - + public function getPreviousChapterId(ChapterId $chapterId): ?ChapterId; - + public function getNextChapterId(ChapterId $chapterId): ?ChapterId; public function getPageContent(ChapterId $chapterId, PageNumber $pageNumber): PageContent; -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/Exception/ChapterNotFoundException.php b/src/Domain/Reader/Domain/Exception/ChapterNotFoundException.php index fb31752..c17dde7 100644 --- a/src/Domain/Reader/Domain/Exception/ChapterNotFoundException.php +++ b/src/Domain/Reader/Domain/Exception/ChapterNotFoundException.php @@ -13,4 +13,4 @@ final class ChapterNotFoundException extends NotFoundHttpException { return new self(sprintf('Le chapitre %s n\'existe pas', $chapterId->getValue())); } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/Exception/PageNotFoundException.php b/src/Domain/Reader/Domain/Exception/PageNotFoundException.php index 18e81da..7d3af75 100644 --- a/src/Domain/Reader/Domain/Exception/PageNotFoundException.php +++ b/src/Domain/Reader/Domain/Exception/PageNotFoundException.php @@ -14,4 +14,4 @@ final class PageNotFoundException extends NotFoundHttpException { return new self(sprintf('La page %d du chapitre %s n\'existe pas', $pageNumber->getValue(), $chapterId->getValue())); } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/Model/ChapterContext.php b/src/Domain/Reader/Domain/Model/ChapterContext.php index 6dc5951..7c9fe82 100644 --- a/src/Domain/Reader/Domain/Model/ChapterContext.php +++ b/src/Domain/Reader/Domain/Model/ChapterContext.php @@ -20,7 +20,8 @@ readonly class ChapterContext private int $totalPages, private bool $isVisible, private \DateTimeImmutable $createdAt - ) {} + ) { + } public function getId(): ChapterId { @@ -76,4 +77,4 @@ readonly class ChapterContext { return $this->createdAt; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/Model/Page.php b/src/Domain/Reader/Domain/Model/Page.php index 5d61468..34dea5b 100644 --- a/src/Domain/Reader/Domain/Model/Page.php +++ b/src/Domain/Reader/Domain/Model/Page.php @@ -49,4 +49,4 @@ class Page 'height' => $this->height, ]; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/Model/PageContent.php b/src/Domain/Reader/Domain/Model/PageContent.php index 41677cb..4366d1d 100644 --- a/src/Domain/Reader/Domain/Model/PageContent.php +++ b/src/Domain/Reader/Domain/Model/PageContent.php @@ -45,4 +45,4 @@ final readonly class PageContent 'height' => $this->height, ]; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/ValueObject/ChapterId.php b/src/Domain/Reader/Domain/ValueObject/ChapterId.php index 3e45c70..f018ca7 100644 --- a/src/Domain/Reader/Domain/ValueObject/ChapterId.php +++ b/src/Domain/Reader/Domain/ValueObject/ChapterId.php @@ -8,7 +8,8 @@ readonly class ChapterId { public function __construct( private string $value - ) {} + ) { + } public function getValue(): string { @@ -19,4 +20,4 @@ readonly class ChapterId { return $this->value === $other->value; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Domain/ValueObject/PageNumber.php b/src/Domain/Reader/Domain/ValueObject/PageNumber.php index fd73c98..a957f1e 100644 --- a/src/Domain/Reader/Domain/ValueObject/PageNumber.php +++ b/src/Domain/Reader/Domain/ValueObject/PageNumber.php @@ -15,7 +15,7 @@ final class PageNumber if ($value < 1) { throw new InvalidArgumentException('Le numéro de page doit être supérieur à 0'); } - + $this->value = $value; } @@ -33,4 +33,4 @@ final class PageNumber { return (string) $this->value; } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Infrastructure/ApiPlatform/Resource/ChapterPageResource.php b/src/Domain/Reader/Infrastructure/ApiPlatform/Resource/ChapterPageResource.php index 34ccad8..93bf53e 100644 --- a/src/Domain/Reader/Infrastructure/ApiPlatform/Resource/ChapterPageResource.php +++ b/src/Domain/Reader/Infrastructure/ApiPlatform/Resource/ChapterPageResource.php @@ -70,4 +70,4 @@ class ChapterPageResource public function __construct() { } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterContextProvider.php b/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterContextProvider.php index 55e110c..3301c80 100644 --- a/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterContextProvider.php +++ b/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterContextProvider.php @@ -10,7 +10,6 @@ use App\Domain\Reader\Application\Query\GetChapterContext; use App\Domain\Reader\Application\QueryHandler\GetChapterContextHandler; use App\Domain\Reader\Application\Response\ChapterContextResponse; - final readonly class ChapterContextProvider implements ProviderInterface { public function __construct( diff --git a/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterPageProvider.php b/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterPageProvider.php index 04d219b..76204a0 100644 --- a/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterPageProvider.php +++ b/src/Domain/Reader/Infrastructure/ApiPlatform/State/Provider/ChapterPageProvider.php @@ -26,4 +26,4 @@ final readonly class ChapterPageProvider implements ProviderInterface ) ); } -} \ No newline at end of file +} diff --git a/src/Domain/Reader/Infrastructure/Persistence/LegacyChapterRepository.php b/src/Domain/Reader/Infrastructure/Persistence/LegacyChapterRepository.php index 4d29d3a..30d2c29 100644 --- a/src/Domain/Reader/Infrastructure/Persistence/LegacyChapterRepository.php +++ b/src/Domain/Reader/Infrastructure/Persistence/LegacyChapterRepository.php @@ -20,7 +20,8 @@ readonly class LegacyChapterRepository implements ChapterRepositoryInterface { public function __construct( private EntityManagerInterface $entityManager - ) {} + ) { + } public function getPagesForChapter(ChapterId $chapterId, int $page = 1, int $itemsPerPage = 20): array { diff --git a/src/Domain/Scraping/Application/Command/TestScraperConfiguration.php b/src/Domain/Scraping/Application/Command/TestScraperConfiguration.php index 4015a1c..db7999d 100644 --- a/src/Domain/Scraping/Application/Command/TestScraperConfiguration.php +++ b/src/Domain/Scraping/Application/Command/TestScraperConfiguration.php @@ -14,5 +14,6 @@ readonly class TestScraperConfiguration public ?string $imageSelector = null, public ?string $nextPageSelector = null, public ?string $chapterSelector = null, - ) {} + ) { + } } diff --git a/src/Domain/Scraping/Application/CommandHandler/ScrapeChapterHandler.php b/src/Domain/Scraping/Application/CommandHandler/ScrapeChapterHandler.php index ecbcb14..1f5621b 100644 --- a/src/Domain/Scraping/Application/CommandHandler/ScrapeChapterHandler.php +++ b/src/Domain/Scraping/Application/CommandHandler/ScrapeChapterHandler.php @@ -117,7 +117,7 @@ readonly class ScrapeChapterHandler $chapter->volumeNumber, $chapter->chapterNumber, $tempDir, - array_map(fn($r) => $r->getLocalPath(), $downloadResults) + array_map(fn ($r) => $r->getLocalPath(), $downloadResults) ); $cbzPath = $this->cbzGenerator->generate($cbzRequest); diff --git a/src/Domain/Scraping/Application/CommandHandler/TestScraperConfigurationHandler.php b/src/Domain/Scraping/Application/CommandHandler/TestScraperConfigurationHandler.php index 5ebbeb4..cda15b7 100644 --- a/src/Domain/Scraping/Application/CommandHandler/TestScraperConfigurationHandler.php +++ b/src/Domain/Scraping/Application/CommandHandler/TestScraperConfigurationHandler.php @@ -12,7 +12,8 @@ readonly class TestScraperConfigurationHandler { public function __construct( private ScraperFactoryInterface $scraperFactory - ) {} + ) { + } public function handle(TestScraperConfiguration $command): TestScraperConfigurationResponse { diff --git a/src/Domain/Scraping/Application/Response/TestScraperConfigurationResponse.php b/src/Domain/Scraping/Application/Response/TestScraperConfigurationResponse.php index 265d7ba..731dff2 100644 --- a/src/Domain/Scraping/Application/Response/TestScraperConfigurationResponse.php +++ b/src/Domain/Scraping/Application/Response/TestScraperConfigurationResponse.php @@ -11,7 +11,8 @@ readonly class TestScraperConfigurationResponse public string $testedUrl, public string $scrapingType, public array $errors = [], - ) {} + ) { + } public static function success(array $imageUrls, string $testedUrl, string $scrapingType): self { diff --git a/src/Domain/Scraping/Domain/Exception/CbzGenerationException.php b/src/Domain/Scraping/Domain/Exception/CbzGenerationException.php index 1632894..6d7c314 100644 --- a/src/Domain/Scraping/Domain/Exception/CbzGenerationException.php +++ b/src/Domain/Scraping/Domain/Exception/CbzGenerationException.php @@ -18,4 +18,4 @@ class CbzGenerationException extends \RuntimeException { return new self(sprintf('Impossible d\'ajouter le fichier à l\'archive : %s', $filePath)); } -} \ No newline at end of file +} diff --git a/src/Domain/Scraping/Domain/Model/Chapter.php b/src/Domain/Scraping/Domain/Model/Chapter.php index bd854a3..2792dc0 100644 --- a/src/Domain/Scraping/Domain/Model/Chapter.php +++ b/src/Domain/Scraping/Domain/Model/Chapter.php @@ -10,5 +10,6 @@ class Chapter public readonly float $chapterNumber, public readonly ?int $volumeNumber, public ?string $cbzPath, - ) {} + ) { + } } diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/GetMangaPreferredSourcesResource.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/GetMangaPreferredSourcesResource.php index 1c8b6e2..bddceaf 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/GetMangaPreferredSourcesResource.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/GetMangaPreferredSourcesResource.php @@ -77,5 +77,6 @@ class GetMangaPreferredSourcesResource { public function __construct( public string $id - ) {} + ) { + } } diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/SetMangaPreferredSourcesResource.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/SetMangaPreferredSourcesResource.php index 5814697..0dc50ed 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/SetMangaPreferredSourcesResource.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/SetMangaPreferredSourcesResource.php @@ -50,5 +50,6 @@ class SetMangaPreferredSourcesResource new Assert\Type('string') ])] public array $sourceIds = [] - ) {} + ) { + } } diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationRequest.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationRequest.php index 6a5c478..13e3e02 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationRequest.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationRequest.php @@ -305,7 +305,6 @@ readonly class TestScraperConfigurationRequest #[Assert\NotBlank(message: 'L\'URL de base est obligatoire')] #[Assert\Url(message: 'L\'URL de base doit être une URL valide')] public string $baseUrl, - #[ApiProperty( description: 'Format d\'URL pour accéder aux chapitres. Utilisez {slug} pour le nom du manga et {chapter} pour le numéro de chapitre', example: 'https://mangasite.example.com/manga/{slug}/chapter/{chapter}', @@ -313,7 +312,6 @@ readonly class TestScraperConfigurationRequest )] #[Assert\NotBlank(message: 'Le format d\'URL de chapitre est obligatoire')] public string $chapterUrlFormat, - #[ApiProperty( description: 'Type de scraping à utiliser. "html" pour les sites statiques, "javascript" pour les sites avec contenu dynamique', example: 'html', @@ -322,7 +320,6 @@ readonly class TestScraperConfigurationRequest #[Assert\NotBlank(message: 'Le type de scraping est obligatoire')] #[Assert\Choice(choices: ['html', 'javascript'], message: 'Le type de scraping doit être html ou javascript')] public string $scrapingType, - #[ApiProperty( description: 'URL complète d\'un chapitre existant à utiliser pour tester la configuration. Cette URL doit être accessible et contenir des images', example: 'https://mangasite.example.com/manga/one-piece/chapter/1', @@ -331,7 +328,6 @@ readonly class TestScraperConfigurationRequest #[Assert\NotBlank(message: 'L\'URL de test est obligatoire')] #[Assert\Url(message: 'L\'URL de test doit être une URL valide')] public string $testUrl, - #[ApiProperty( description: 'Identifiant du manga utilisé dans les URLs (slug). Sera utilisé pour remplacer {slug} dans le format d\'URL', example: 'one-piece', @@ -339,7 +335,6 @@ readonly class TestScraperConfigurationRequest )] #[Assert\NotBlank(message: 'Le slug du manga est obligatoire')] public string $mangaSlug, - #[ApiProperty( description: 'Numéro du chapitre à tester. Peut être décimal pour les chapitres spéciaux (ex: 1.5)', example: 1.0, @@ -349,7 +344,6 @@ readonly class TestScraperConfigurationRequest #[Assert\Type(type: 'numeric', message: 'Le numéro de chapitre doit être numérique')] #[Assert\Positive(message: 'Le numéro de chapitre doit être positif')] public float $chapterNumber, - #[ApiProperty( description: 'Sélecteur CSS pour identifier les images du manga sur la page. Exemples: "img.manga-page", ".chapter img", "#reader img"', example: 'img.manga-page, .chapter-image img', @@ -357,7 +351,6 @@ readonly class TestScraperConfigurationRequest )] #[Assert\Length(min: 1, max: 500, minMessage: 'Le sélecteur d\'image ne peut pas être vide', maxMessage: 'Le sélecteur d\'image est trop long')] public ?string $imageSelector = null, - #[ApiProperty( description: 'Sélecteur CSS pour le lien vers la page suivante (requis pour les lecteurs horizontaux). Exemples: "a.next", ".navigation .next-page"', example: 'a.next-page, .navigation .next', @@ -365,7 +358,6 @@ readonly class TestScraperConfigurationRequest )] #[Assert\Length(max: 500, maxMessage: 'Le sélecteur de page suivante est trop long')] public ?string $nextPageSelector = null, - #[ApiProperty( description: 'Sélecteur CSS pour délimiter la zone contenant le chapitre (optionnel). Utile pour cibler une zone spécifique de la page', example: '.chapter-content, #manga-reader', @@ -373,5 +365,6 @@ readonly class TestScraperConfigurationRequest )] #[Assert\Length(max: 500, maxMessage: 'Le sélecteur de chapitre est trop long')] public ?string $chapterSelector = null, - ) {} + ) { + } } diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationResource.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationResource.php index 738a83d..566e919 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationResource.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/Resource/TestScraperConfigurationResource.php @@ -13,7 +13,6 @@ readonly class TestScraperConfigurationResource schema: ['type' => 'boolean'] )] public bool $success, - #[ApiProperty( description: 'Liste des URLs d\'images trouvées lors du scraping. Vide en cas d\'échec.', example: [ @@ -29,28 +28,24 @@ readonly class TestScraperConfigurationResource ] )] public array $imageUrls, - #[ApiProperty( description: 'Nombre total d\'images trouvées', example: 2, schema: ['type' => 'integer', 'minimum' => 0] )] public int $totalImages, - #[ApiProperty( description: 'URL qui a été testée', example: 'https://mangasite.example.com/manga/one-piece/chapter/1', schema: ['type' => 'string', 'format' => 'uri'] )] public string $testedUrl, - #[ApiProperty( description: 'Type de scraping qui a été utilisé pour le test', example: 'html', schema: ['type' => 'string', 'enum' => ['html', 'javascript']] )] public string $scrapingType, - #[ApiProperty( description: 'Liste des erreurs détaillées en cas d\'échec. Vide en cas de succès. Chaque erreur contient un type, le champ concerné, un message et une suggestion.', example: [ @@ -89,5 +84,6 @@ readonly class TestScraperConfigurationResource ] )] public array $errors = [], - ) {} + ) { + } } diff --git a/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/TestScraperConfigurationStateProcessor.php b/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/TestScraperConfigurationStateProcessor.php index 2fd99c0..7149fce 100644 --- a/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/TestScraperConfigurationStateProcessor.php +++ b/src/Domain/Scraping/Infrastructure/ApiPlatform/State/Processor/TestScraperConfigurationStateProcessor.php @@ -13,7 +13,8 @@ readonly class TestScraperConfigurationStateProcessor implements ProcessorInterf { public function __construct( private TestScraperConfigurationHandler $handler - ) {} + ) { + } public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): TestScraperConfigurationResource { diff --git a/src/Domain/Scraping/Infrastructure/EventListener/AutoScrapingListener.php b/src/Domain/Scraping/Infrastructure/EventListener/AutoScrapingListener.php index fa98be7..bd4210b 100644 --- a/src/Domain/Scraping/Infrastructure/EventListener/AutoScrapingListener.php +++ b/src/Domain/Scraping/Infrastructure/EventListener/AutoScrapingListener.php @@ -15,7 +15,8 @@ class AutoScrapingListener private readonly ScrapeChapterHandler $scrapeChapterHandler, private readonly ChapterRepositoryInterface $chapterRepository, private readonly MangaRepositoryInterface $mangaRepository, - ) {} + ) { + } #[AsMessageHandler] public function onChapterReadyForScraping(ChapterReadyForScraping $event): void diff --git a/src/Domain/Scraping/Infrastructure/Persistence/LegacyChapterRepository.php b/src/Domain/Scraping/Infrastructure/Persistence/LegacyChapterRepository.php index 97773b4..215a9ee 100644 --- a/src/Domain/Scraping/Infrastructure/Persistence/LegacyChapterRepository.php +++ b/src/Domain/Scraping/Infrastructure/Persistence/LegacyChapterRepository.php @@ -7,11 +7,13 @@ use App\Domain\Scraping\Domain\Exception\ChapterNotFoundException; use App\Domain\Scraping\Domain\Model\Chapter; use App\Entity\Chapter as EntityChapter; use Doctrine\ORM\EntityManagerInterface; + readonly class LegacyChapterRepository implements ChapterRepositoryInterface { public function __construct( private EntityManagerInterface $entityManager, - ) {} + ) { + } /** * Récupère un chapitre par son identifiant diff --git a/src/Domain/Scraping/Infrastructure/Persistence/LegacyMangaRepository.php b/src/Domain/Scraping/Infrastructure/Persistence/LegacyMangaRepository.php index 1cf2458..923a09d 100644 --- a/src/Domain/Scraping/Infrastructure/Persistence/LegacyMangaRepository.php +++ b/src/Domain/Scraping/Infrastructure/Persistence/LegacyMangaRepository.php @@ -71,7 +71,7 @@ readonly class LegacyMangaRepository implements MangaRepositoryInterface } else { // Valider que toutes les sources existent avant de les sauvegarder $sources = $this->entityManager->getRepository(ContentSource::class)->findBy(['id' => $sourceIds]); - $existingSourceIds = array_map(fn($source) => (string) $source->getId(), $sources); + $existingSourceIds = array_map(fn ($source) => (string) $source->getId(), $sources); // Garder uniquement les sources qui existent et maintenir l'ordre $validSourceIds = array_values(array_intersect($sourceIds, $existingSourceIds)); diff --git a/src/Domain/Scraping/Infrastructure/Service/Scraper/AdvancedHtmlScraper.php b/src/Domain/Scraping/Infrastructure/Service/Scraper/AdvancedHtmlScraper.php index 0a5cb47..663be88 100644 --- a/src/Domain/Scraping/Infrastructure/Service/Scraper/AdvancedHtmlScraper.php +++ b/src/Domain/Scraping/Infrastructure/Service/Scraper/AdvancedHtmlScraper.php @@ -89,7 +89,7 @@ class AdvancedHtmlScraper implements ScraperInterface return $this->cleanImageUrl($src); }); - return array_filter($images, fn($url) => !empty($url)); + return array_filter($images, fn ($url) => !empty($url)); } private function scrapeHorizontalReader(ScrapingRequest $request): array @@ -143,7 +143,7 @@ class AdvancedHtmlScraper implements ScraperInterface sleep(1); } - return array_filter($pages, fn($url) => !empty($url)); + return array_filter($pages, fn ($url) => !empty($url)); } private function fetchHtmlWithRetry(string $url): string diff --git a/src/Domain/Scraping/Infrastructure/Service/Scraper/JavaScriptScraper.php b/src/Domain/Scraping/Infrastructure/Service/Scraper/JavaScriptScraper.php index e455815..dee9398 100644 --- a/src/Domain/Scraping/Infrastructure/Service/Scraper/JavaScriptScraper.php +++ b/src/Domain/Scraping/Infrastructure/Service/Scraper/JavaScriptScraper.php @@ -16,7 +16,8 @@ class JavaScriptScraper implements ScraperInterface public function __construct( private readonly string $projectDir - ) {} + ) { + } public function scrape(ScrapingRequest $request): ScrapingResult { @@ -44,7 +45,7 @@ class JavaScriptScraper implements ScraperInterface return 'javascript' === $sourceType; } - private function scrapeVerticalReader(ScrapingRequest $request, string $scriptPath): array + private function scrapeVerticalReader(ScrapingRequest $request, string $scriptPath): array { $params = $request->getScrapingParameters(); $processArgs = [ @@ -70,7 +71,7 @@ class JavaScriptScraper implements ScraperInterface return $this->executeProcess($process); } - private function scrapeHorizontalReader(ScrapingRequest $request, string $scriptPath): array + private function scrapeHorizontalReader(ScrapingRequest $request, string $scriptPath): array { $params = $request->getScrapingParameters(); @@ -143,10 +144,10 @@ class JavaScriptScraper implements ScraperInterface { return array_filter( array_map( - fn($url) => $this->cleanImageUrl($url), + fn ($url) => $this->cleanImageUrl($url), $urls ), - fn($url) => !empty($url) && filter_var($url, FILTER_VALIDATE_URL) + fn ($url) => !empty($url) && filter_var($url, FILTER_VALIDATE_URL) ); } diff --git a/src/Domain/Scraping/Infrastructure/Service/ScraperFactory.php b/src/Domain/Scraping/Infrastructure/Service/ScraperFactory.php index 8bcf116..f653098 100644 --- a/src/Domain/Scraping/Infrastructure/Service/ScraperFactory.php +++ b/src/Domain/Scraping/Infrastructure/Service/ScraperFactory.php @@ -54,7 +54,7 @@ class ScraperFactory implements ScraperFactoryInterface public function getBestScraper(): ScraperInterface { $sortedTypes = array_keys(self::SCRAPER_PRIORITIES); - usort($sortedTypes, fn($a, $b) => self::SCRAPER_PRIORITIES[$a] <=> self::SCRAPER_PRIORITIES[$b]); + usort($sortedTypes, fn ($a, $b) => self::SCRAPER_PRIORITIES[$a] <=> self::SCRAPER_PRIORITIES[$b]); return $this->scrapers[$sortedTypes[0]]; } diff --git a/src/Domain/Setting/Application/Command/ImportContentSourceCommand.php b/src/Domain/Setting/Application/Command/ImportContentSourceCommand.php index 1f3fc9a..184360e 100644 --- a/src/Domain/Setting/Application/Command/ImportContentSourceCommand.php +++ b/src/Domain/Setting/Application/Command/ImportContentSourceCommand.php @@ -6,5 +6,6 @@ readonly class ImportContentSourceCommand { public function __construct( public array $contentSources - ) {} + ) { + } } diff --git a/src/Domain/Setting/Application/Command/UpsertContentSourceCommand.php b/src/Domain/Setting/Application/Command/UpsertContentSourceCommand.php index 678cf0e..3949457 100644 --- a/src/Domain/Setting/Application/Command/UpsertContentSourceCommand.php +++ b/src/Domain/Setting/Application/Command/UpsertContentSourceCommand.php @@ -12,5 +12,6 @@ readonly class UpsertContentSourceCommand public ?string $imageSelector = null, public ?string $nextPageSelector = null, public ?string $chapterSelector = null, - ) {} + ) { + } } diff --git a/src/Domain/Setting/Application/CommandHandler/ImportContentSourceCommandHandler.php b/src/Domain/Setting/Application/CommandHandler/ImportContentSourceCommandHandler.php index 08d7e6f..3ab0442 100644 --- a/src/Domain/Setting/Application/CommandHandler/ImportContentSourceCommandHandler.php +++ b/src/Domain/Setting/Application/CommandHandler/ImportContentSourceCommandHandler.php @@ -11,7 +11,8 @@ readonly class ImportContentSourceCommandHandler { public function __construct( private ContentSourceRepositoryInterface $contentSourceRepository - ) {} + ) { + } public function handle(ImportContentSourceCommand $command): void { diff --git a/src/Domain/Setting/Application/CommandHandler/UpsertContentSourceCommandHandler.php b/src/Domain/Setting/Application/CommandHandler/UpsertContentSourceCommandHandler.php index 0df66c1..4fcfb36 100644 --- a/src/Domain/Setting/Application/CommandHandler/UpsertContentSourceCommandHandler.php +++ b/src/Domain/Setting/Application/CommandHandler/UpsertContentSourceCommandHandler.php @@ -10,7 +10,8 @@ readonly class UpsertContentSourceCommandHandler { public function __construct( private ContentSourceRepositoryInterface $contentSourceRepository - ) {} + ) { + } public function handle(UpsertContentSourceCommand $command): void { diff --git a/src/Domain/Setting/Application/Query/GetContentSourceQuery.php b/src/Domain/Setting/Application/Query/GetContentSourceQuery.php index 4c64332..993cf25 100644 --- a/src/Domain/Setting/Application/Query/GetContentSourceQuery.php +++ b/src/Domain/Setting/Application/Query/GetContentSourceQuery.php @@ -6,5 +6,6 @@ readonly class GetContentSourceQuery { public function __construct( public int $id - ) {} + ) { + } } diff --git a/src/Domain/Setting/Application/QueryHandler/ExportContentSourceQueryHandler.php b/src/Domain/Setting/Application/QueryHandler/ExportContentSourceQueryHandler.php index 0b390be..abfd10d 100644 --- a/src/Domain/Setting/Application/QueryHandler/ExportContentSourceQueryHandler.php +++ b/src/Domain/Setting/Application/QueryHandler/ExportContentSourceQueryHandler.php @@ -11,7 +11,8 @@ readonly class ExportContentSourceQueryHandler { public function __construct( private ContentSourceRepositoryInterface $contentSourceRepository - ) {} + ) { + } public function handle(ExportContentSourceQuery $query): ExportContentSourceResponse { diff --git a/src/Domain/Setting/Application/QueryHandler/GetContentSourceQueryHandler.php b/src/Domain/Setting/Application/QueryHandler/GetContentSourceQueryHandler.php index db3b74c..447658f 100644 --- a/src/Domain/Setting/Application/QueryHandler/GetContentSourceQueryHandler.php +++ b/src/Domain/Setting/Application/QueryHandler/GetContentSourceQueryHandler.php @@ -11,7 +11,8 @@ readonly class GetContentSourceQueryHandler { public function __construct( private ContentSourceRepositoryInterface $contentSourceRepository - ) {} + ) { + } public function handle(GetContentSourceQuery $query): ContentSourceResponse { diff --git a/src/Domain/Setting/Application/QueryHandler/ListContentSourceQueryHandler.php b/src/Domain/Setting/Application/QueryHandler/ListContentSourceQueryHandler.php index 2b2535f..fb0ddee 100644 --- a/src/Domain/Setting/Application/QueryHandler/ListContentSourceQueryHandler.php +++ b/src/Domain/Setting/Application/QueryHandler/ListContentSourceQueryHandler.php @@ -11,14 +11,15 @@ readonly class ListContentSourceQueryHandler { public function __construct( private ContentSourceRepositoryInterface $contentSourceRepository - ) {} + ) { + } public function handle(ListContentSourceQuery $query): ContentSourceListResponse { $contentSources = $this->contentSourceRepository->findAll(); $responses = array_map( - fn($contentSource) => ContentSourceResponse::fromDomain($contentSource), + fn ($contentSource) => ContentSourceResponse::fromDomain($contentSource), $contentSources ); diff --git a/src/Domain/Setting/Application/Response/ContentSourceListResponse.php b/src/Domain/Setting/Application/Response/ContentSourceListResponse.php index f390d6b..60efb97 100644 --- a/src/Domain/Setting/Application/Response/ContentSourceListResponse.php +++ b/src/Domain/Setting/Application/Response/ContentSourceListResponse.php @@ -10,5 +10,6 @@ readonly class ContentSourceListResponse public function __construct( public array $contentSources, public int $total, - ) {} + ) { + } } diff --git a/src/Domain/Setting/Application/Response/ContentSourceResponse.php b/src/Domain/Setting/Application/Response/ContentSourceResponse.php index eb25bb9..b9841cd 100644 --- a/src/Domain/Setting/Application/Response/ContentSourceResponse.php +++ b/src/Domain/Setting/Application/Response/ContentSourceResponse.php @@ -15,7 +15,8 @@ readonly class ContentSourceResponse public ?string $nextPageSelector, public ?string $chapterSelector, public string $cleanBaseUrl, - ) {} + ) { + } public static function fromDomain(ContentSource $contentSource): self { diff --git a/src/Domain/Setting/Application/Response/ExportContentSourceResponse.php b/src/Domain/Setting/Application/Response/ExportContentSourceResponse.php index fc25072..bf054d2 100644 --- a/src/Domain/Setting/Application/Response/ExportContentSourceResponse.php +++ b/src/Domain/Setting/Application/Response/ExportContentSourceResponse.php @@ -7,5 +7,6 @@ readonly class ExportContentSourceResponse public function __construct( public array $contentSources, public string $exportDate, - ) {} + ) { + } } diff --git a/src/Domain/Setting/Domain/Model/ContentSource.php b/src/Domain/Setting/Domain/Model/ContentSource.php index 5c7fa79..2dbe928 100644 --- a/src/Domain/Setting/Domain/Model/ContentSource.php +++ b/src/Domain/Setting/Domain/Model/ContentSource.php @@ -12,7 +12,8 @@ final class ContentSource private ?string $imageSelector = null, private ?string $nextPageSelector = null, private ?string $chapterSelector = null, - ) {} + ) { + } public function getId(): ?int { diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/GetContentSourceResource.php b/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/GetContentSourceResource.php index 3997745..1fa0ffc 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/GetContentSourceResource.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/GetContentSourceResource.php @@ -30,5 +30,6 @@ class GetContentSourceResource public readonly ?string $nextPageSelector, public readonly ?string $chapterSelector, public readonly string $cleanBaseUrl, - ) {} + ) { + } } diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/ImportContentSourceResource.php b/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/ImportContentSourceResource.php index 8ea86f7..8c7a77f 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/ImportContentSourceResource.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/ImportContentSourceResource.php @@ -26,5 +26,6 @@ class ImportContentSourceResource #[Assert\Type('array', message: 'Les sources de contenu doivent être un tableau')] #[Assert\Count(min: 1, minMessage: 'Au moins une source de contenu doit être fournie')] public readonly array $contentSources = [] - ) {} + ) { + } } diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/UpsertContentSourceResource.php b/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/UpsertContentSourceResource.php index cd5b9f0..cf86496 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/UpsertContentSourceResource.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/UpsertContentSourceResource.php @@ -32,20 +32,17 @@ class UpsertContentSourceResource { public function __construct( public readonly ?int $id = null, - #[Assert\NotBlank(message: 'L\'URL de base est obligatoire')] #[Assert\Url(message: 'L\'URL de base doit être une URL valide')] public readonly string $baseUrl = '', - #[Assert\NotBlank(message: 'Le format d\'URL de chapitre est obligatoire')] public readonly string $chapterUrlFormat = '', - #[Assert\NotBlank(message: 'Le type de scraping est obligatoire')] #[Assert\Choice(choices: ['html', 'javascript'], message: 'Le type de scraping doit être html ou javascript')] public readonly string $scrapingType = '', - public readonly ?string $imageSelector = null, public readonly ?string $nextPageSelector = null, public readonly ?string $chapterSelector = null, - ) {} + ) { + } } diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/ImportContentSourceStateProcessor.php b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/ImportContentSourceStateProcessor.php index 13c155a..2c6bf18 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/ImportContentSourceStateProcessor.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/ImportContentSourceStateProcessor.php @@ -15,7 +15,8 @@ readonly class ImportContentSourceStateProcessor implements ProcessorInterface { public function __construct( private ImportContentSourceCommandHandler $handler - ) {} + ) { + } public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): int { diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/UpsertContentSourceStateProcessor.php b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/UpsertContentSourceStateProcessor.php index 9958510..ef685a6 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/UpsertContentSourceStateProcessor.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Processor/UpsertContentSourceStateProcessor.php @@ -13,7 +13,8 @@ readonly class UpsertContentSourceStateProcessor implements ProcessorInterface { public function __construct( private UpsertContentSourceCommandHandler $handler - ) {} + ) { + } public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): int { diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ExportContentSourceStateProvider.php b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ExportContentSourceStateProvider.php index d09ed7d..8b4b1e4 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ExportContentSourceStateProvider.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ExportContentSourceStateProvider.php @@ -11,7 +11,8 @@ readonly class ExportContentSourceStateProvider implements ProviderInterface { public function __construct( private ExportContentSourceQueryHandler $handler - ) {} + ) { + } public function provide(Operation $operation, array $uriVariables = [], array $context = []): array { diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/GetContentSourceStateProvider.php b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/GetContentSourceStateProvider.php index f5d5c5c..7bb9ae5 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/GetContentSourceStateProvider.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/GetContentSourceStateProvider.php @@ -14,7 +14,8 @@ readonly class GetContentSourceStateProvider implements ProviderInterface { public function __construct( private GetContentSourceQueryHandler $handler - ) {} + ) { + } public function provide(Operation $operation, array $uriVariables = [], array $context = []): ?GetContentSourceResource { diff --git a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ListContentSourceStateProvider.php b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ListContentSourceStateProvider.php index 48325ea..f28f4f2 100644 --- a/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ListContentSourceStateProvider.php +++ b/src/Domain/Setting/Infrastructure/ApiPlatform/State/Provider/ListContentSourceStateProvider.php @@ -12,7 +12,8 @@ readonly class ListContentSourceStateProvider implements ProviderInterface { public function __construct( private ListContentSourceQueryHandler $handler - ) {} + ) { + } public function provide(Operation $operation, array $uriVariables = [], array $context = []): array { @@ -20,7 +21,7 @@ readonly class ListContentSourceStateProvider implements ProviderInterface $response = $this->handler->handle($query); return array_map( - fn($contentSourceResponse) => new GetContentSourceResource( + fn ($contentSourceResponse) => new GetContentSourceResource( id: $contentSourceResponse->id, baseUrl: $contentSourceResponse->baseUrl, chapterUrlFormat: $contentSourceResponse->chapterUrlFormat, diff --git a/src/Domain/Setting/Infrastructure/Persistence/Repository/DoctrineContentSourceRepository.php b/src/Domain/Setting/Infrastructure/Persistence/Repository/DoctrineContentSourceRepository.php index a613655..2eb3440 100644 --- a/src/Domain/Setting/Infrastructure/Persistence/Repository/DoctrineContentSourceRepository.php +++ b/src/Domain/Setting/Infrastructure/Persistence/Repository/DoctrineContentSourceRepository.php @@ -13,14 +13,15 @@ readonly class DoctrineContentSourceRepository implements ContentSourceRepositor public function __construct( private EntityManagerInterface $entityManager, private ContentSourceMapper $mapper - ) {} + ) { + } public function findAll(): array { $entities = $this->entityManager->getRepository(ContentSourceEntity::class)->findAll(); return array_map( - fn(ContentSourceEntity $entity) => $this->mapper->toDomain($entity), + fn (ContentSourceEntity $entity) => $this->mapper->toDomain($entity), $entities ); } diff --git a/src/Domain/Shared/Application/QueryHandler/ListJobsQueryHandler.php b/src/Domain/Shared/Application/QueryHandler/ListJobsQueryHandler.php index 28e4e76..29eaadf 100644 --- a/src/Domain/Shared/Application/QueryHandler/ListJobsQueryHandler.php +++ b/src/Domain/Shared/Application/QueryHandler/ListJobsQueryHandler.php @@ -15,7 +15,8 @@ readonly class ListJobsQueryHandler implements QueryHandlerInterface { public function __construct( private JobRepositoryInterface $jobRepository - ) {} + ) { + } public function handle(QueryInterface $query): ResponseInterface { diff --git a/src/Domain/Shared/Application/Response/JobListResponse.php b/src/Domain/Shared/Application/Response/JobListResponse.php index 1d232b8..a18ed84 100644 --- a/src/Domain/Shared/Application/Response/JobListResponse.php +++ b/src/Domain/Shared/Application/Response/JobListResponse.php @@ -18,7 +18,8 @@ readonly class JobListResponse implements ResponseInterface public int $page, public int $limit, public int $pages - ) {} + ) { + } public static function fromJobs(array $jobs, int $total, int $page, int $limit): self { diff --git a/src/Domain/Shared/Domain/Contract/CommandHandlerInterface.php b/src/Domain/Shared/Domain/Contract/CommandHandlerInterface.php index a9fe28f..fb0d0c8 100644 --- a/src/Domain/Shared/Domain/Contract/CommandHandlerInterface.php +++ b/src/Domain/Shared/Domain/Contract/CommandHandlerInterface.php @@ -12,4 +12,4 @@ interface CommandHandlerInterface * @return void */ public function handle(CommandInterface $command): void; -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Contract/CommandInterface.php b/src/Domain/Shared/Domain/Contract/CommandInterface.php index e621403..1967dde 100644 --- a/src/Domain/Shared/Domain/Contract/CommandInterface.php +++ b/src/Domain/Shared/Domain/Contract/CommandInterface.php @@ -6,4 +6,4 @@ namespace App\Domain\Shared\Domain\Contract; interface CommandInterface { -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Contract/FailedJobRepositoryInterface.php b/src/Domain/Shared/Domain/Contract/FailedJobRepositoryInterface.php index 480ca56..4789f43 100644 --- a/src/Domain/Shared/Domain/Contract/FailedJobRepositoryInterface.php +++ b/src/Domain/Shared/Domain/Contract/FailedJobRepositoryInterface.php @@ -12,4 +12,4 @@ interface FailedJobRepositoryInterface public function findAll(): array; public function findByJobType(string $jobType): array; public function findRetryableJobs(): array; -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Contract/MangaPathManagerInterface.php b/src/Domain/Shared/Domain/Contract/MangaPathManagerInterface.php index fc07618..fb99d6c 100644 --- a/src/Domain/Shared/Domain/Contract/MangaPathManagerInterface.php +++ b/src/Domain/Shared/Domain/Contract/MangaPathManagerInterface.php @@ -47,5 +47,3 @@ interface MangaPathManagerInterface */ public function fileExists(string $path): bool; } - - diff --git a/src/Domain/Shared/Domain/Contract/QueryHandlerInterface.php b/src/Domain/Shared/Domain/Contract/QueryHandlerInterface.php index 0acf976..1b2909e 100644 --- a/src/Domain/Shared/Domain/Contract/QueryHandlerInterface.php +++ b/src/Domain/Shared/Domain/Contract/QueryHandlerInterface.php @@ -13,4 +13,4 @@ interface QueryHandlerInterface * @return R */ public function handle(QueryInterface $query): ResponseInterface; -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Contract/QueryInterface.php b/src/Domain/Shared/Domain/Contract/QueryInterface.php index 948daf7..d5a8f7b 100644 --- a/src/Domain/Shared/Domain/Contract/QueryInterface.php +++ b/src/Domain/Shared/Domain/Contract/QueryInterface.php @@ -6,4 +6,4 @@ namespace App\Domain\Shared\Domain\Contract; interface QueryInterface { -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Contract/ResponseInterface.php b/src/Domain/Shared/Domain/Contract/ResponseInterface.php index a44a93a..4b1a5cf 100644 --- a/src/Domain/Shared/Domain/Contract/ResponseInterface.php +++ b/src/Domain/Shared/Domain/Contract/ResponseInterface.php @@ -6,4 +6,4 @@ namespace App\Domain\Shared\Domain\Contract; interface ResponseInterface { -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Event/ChapterImported.php b/src/Domain/Shared/Domain/Event/ChapterImported.php index a8d5275..0f56042 100644 --- a/src/Domain/Shared/Domain/Event/ChapterImported.php +++ b/src/Domain/Shared/Domain/Event/ChapterImported.php @@ -11,7 +11,6 @@ readonly class ChapterImported public int $volume, public float|string $chapterNumber, public string $cbzPath, - ) {} + ) { + } } - - diff --git a/src/Domain/Shared/Domain/Event/VolumeImported.php b/src/Domain/Shared/Domain/Event/VolumeImported.php index ea74eb5..4ab5424 100644 --- a/src/Domain/Shared/Domain/Event/VolumeImported.php +++ b/src/Domain/Shared/Domain/Event/VolumeImported.php @@ -10,7 +10,6 @@ readonly class VolumeImported public string $mangaSlug, public int $volume, public string $cbzPath, - ) {} + ) { + } } - - diff --git a/src/Domain/Shared/Domain/Exception/JobNotFoundException.php b/src/Domain/Shared/Domain/Exception/JobNotFoundException.php index 822543d..9f997a4 100644 --- a/src/Domain/Shared/Domain/Exception/JobNotFoundException.php +++ b/src/Domain/Shared/Domain/Exception/JobNotFoundException.php @@ -13,4 +13,4 @@ class JobNotFoundException extends \DomainException { return new self(sprintf('Failed job with job id "%s" not found', $jobId)); } -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Exception/JobNotRetryableException.php b/src/Domain/Shared/Domain/Exception/JobNotRetryableException.php index 4234e90..8a52e1b 100644 --- a/src/Domain/Shared/Domain/Exception/JobNotRetryableException.php +++ b/src/Domain/Shared/Domain/Exception/JobNotRetryableException.php @@ -13,4 +13,4 @@ class JobNotRetryableException extends \DomainException { return new self(sprintf('Cannot retry job "%s" because it is not in failed status', $jobId)); } -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Model/FailedJob.php b/src/Domain/Shared/Domain/Model/FailedJob.php index 7ec5b3c..e5377cc 100644 --- a/src/Domain/Shared/Domain/Model/FailedJob.php +++ b/src/Domain/Shared/Domain/Model/FailedJob.php @@ -12,7 +12,8 @@ class FailedJob public readonly array $context, public readonly \DateTimeImmutable $failedAt, public readonly int $attempt - ) {} + ) { + } public static function fromJob(Job $job): self { @@ -26,4 +27,4 @@ class FailedJob attempt: $job->attempts ); } -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Model/Job.php b/src/Domain/Shared/Domain/Model/Job.php index 5ea2372..8d5a377 100644 --- a/src/Domain/Shared/Domain/Model/Job.php +++ b/src/Domain/Shared/Domain/Model/Job.php @@ -21,36 +21,36 @@ abstract class Job $this->createdAt = new \DateTimeImmutable(); } - public function start(): void + public function start(): void { $this->status = JobStatus::IN_PROGRESS; $this->startedAt = new \DateTimeImmutable(); $this->attempts++; } - public function complete(): void + public function complete(): void { $this->status = JobStatus::COMPLETED; $this->completedAt = new \DateTimeImmutable(); } - public function fail(string $reason): void + public function fail(string $reason): void { $this->failureReason = $reason; - $this->status = $this->attempts >= $this->maxAttempts - ? JobStatus::FAILED + $this->status = $this->attempts >= $this->maxAttempts + ? JobStatus::FAILED : JobStatus::PENDING; $this->completedAt = new \DateTimeImmutable(); } - public function cancel(): void + public function cancel(): void { $this->status = JobStatus::CANCELLED; $this->completedAt = new \DateTimeImmutable(); } - public function canBeRetried(): bool + public function canBeRetried(): bool { return $this->status === JobStatus::FAILED && $this->attempts < $this->maxAttempts; } -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Domain/Model/JobStatus.php b/src/Domain/Shared/Domain/Model/JobStatus.php index d72cd9c..3d5bc19 100644 --- a/src/Domain/Shared/Domain/Model/JobStatus.php +++ b/src/Domain/Shared/Domain/Model/JobStatus.php @@ -9,4 +9,4 @@ enum JobStatus: string case COMPLETED = 'completed'; case FAILED = 'failed'; case CANCELLED = 'cancelled'; -} \ No newline at end of file +} diff --git a/src/Domain/Shared/Infrastructure/ApiPlatform/Resource/GetJobListResource.php b/src/Domain/Shared/Infrastructure/ApiPlatform/Resource/GetJobListResource.php index 91eaafc..f733596 100644 --- a/src/Domain/Shared/Infrastructure/ApiPlatform/Resource/GetJobListResource.php +++ b/src/Domain/Shared/Infrastructure/ApiPlatform/Resource/GetJobListResource.php @@ -116,39 +116,31 @@ class GetJobListResource description: 'Identifiant unique du job' )] public readonly string $id, - #[ApiProperty(description: 'Type du job (ex: scraping_job)')] #[Assert\NotBlank] public readonly string $type, - #[ApiProperty(description: 'Status du job')] #[Assert\NotBlank] public readonly string $status, - #[ApiProperty(description: 'Date de création du job')] #[Assert\NotNull] public readonly \DateTimeImmutable $createdAt, - #[ApiProperty(description: 'Date de début d\'exécution du job')] public readonly ?\DateTimeImmutable $startedAt = null, - #[ApiProperty(description: 'Date de fin d\'exécution du job')] public readonly ?\DateTimeImmutable $completedAt = null, - #[ApiProperty(description: 'Raison de l\'échec si le job a échoué')] public readonly ?string $failureReason = null, - #[ApiProperty(description: 'Nombre de tentatives effectuées')] #[Assert\GreaterThanOrEqual(0)] public readonly int $attempts = 0, - #[ApiProperty(description: 'Nombre maximum de tentatives autorisées')] #[Assert\GreaterThan(0)] public readonly int $maxAttempts = 3, - #[ApiProperty(description: 'Données contextuelles du job')] public readonly array $context = [] - ) {} + ) { + } public static function fromJob(\App\Domain\Shared\Domain\Model\Job $job): self { diff --git a/src/Domain/Shared/Infrastructure/ApiPlatform/State/Provider/GetJobListStateProvider.php b/src/Domain/Shared/Infrastructure/ApiPlatform/State/Provider/GetJobListStateProvider.php index 77d471d..403818c 100644 --- a/src/Domain/Shared/Infrastructure/ApiPlatform/State/Provider/GetJobListStateProvider.php +++ b/src/Domain/Shared/Infrastructure/ApiPlatform/State/Provider/GetJobListStateProvider.php @@ -16,7 +16,8 @@ readonly class GetJobListStateProvider implements ProviderInterface { public function __construct( private ListJobsQueryHandler $handler - ) {} + ) { + } public function provide(Operation $operation, array $uriVariables = [], array $context = []): ArrayPaginator { @@ -63,7 +64,7 @@ readonly class GetJobListStateProvider implements ProviderInterface return new ArrayPaginator( array_map( - fn($job) => GetJobListResource::fromJob($job), + fn ($job) => GetJobListResource::fromJob($job), $response->items ), 0, diff --git a/src/Domain/Shared/Infrastructure/Messenger/SymfonyMessengerEventDispatcher.php b/src/Domain/Shared/Infrastructure/Messenger/SymfonyMessengerEventDispatcher.php index daf7553..6a2f06b 100644 --- a/src/Domain/Shared/Infrastructure/Messenger/SymfonyMessengerEventDispatcher.php +++ b/src/Domain/Shared/Infrastructure/Messenger/SymfonyMessengerEventDispatcher.php @@ -1,6 +1,7 @@ getQuery() ->getResult(); - return array_map(fn(FailedJobEntity $entity) => $this->mapper->toDomain($entity), $entities); + return array_map(fn (FailedJobEntity $entity) => $this->mapper->toDomain($entity), $entities); } public function findById(string $id): ?FailedJob @@ -81,10 +81,10 @@ readonly class DoctrineFailedJobRepository implements FailedJobRepositoryInterfa ->getResult(); return array_map( - fn(FailedJobEntity $entity) => $this->mapper->toDomain($entity), + fn (FailedJobEntity $entity) => $this->mapper->toDomain($entity), array_filter( $entities, - fn(FailedJobEntity $entity) => $this->mapper->toDomain($entity)->attempt < 3 + fn (FailedJobEntity $entity) => $this->mapper->toDomain($entity)->attempt < 3 ) ); } @@ -99,6 +99,6 @@ readonly class DoctrineFailedJobRepository implements FailedJobRepositoryInterfa ->getQuery() ->getResult(); - return array_map(fn(FailedJobEntity $entity) => $this->mapper->toDomain($entity), $entities); + return array_map(fn (FailedJobEntity $entity) => $this->mapper->toDomain($entity), $entities); } } diff --git a/src/Domain/Shared/Infrastructure/Persistence/Repository/DoctrineJobRepository.php b/src/Domain/Shared/Infrastructure/Persistence/Repository/DoctrineJobRepository.php index 9a467fe..65814fe 100644 --- a/src/Domain/Shared/Infrastructure/Persistence/Repository/DoctrineJobRepository.php +++ b/src/Domain/Shared/Infrastructure/Persistence/Repository/DoctrineJobRepository.php @@ -70,7 +70,7 @@ readonly class DoctrineJobRepository implements JobRepositoryInterface ->getQuery() ->getResult(); - return array_map(fn(JobEntity $entity) => $this->mapper->toDomain($entity), $entities); + return array_map(fn (JobEntity $entity) => $this->mapper->toDomain($entity), $entities); } public function findPendingJobs(): array @@ -98,7 +98,7 @@ readonly class DoctrineJobRepository implements JobRepositoryInterface ->getQuery() ->getResult(); - return array_map(fn(JobEntity $entity) => $this->mapper->toDomain($entity), $entities); + return array_map(fn (JobEntity $entity) => $this->mapper->toDomain($entity), $entities); } public function findByCriteria(array $criteria): array @@ -149,7 +149,7 @@ readonly class DoctrineJobRepository implements JobRepositoryInterface $entities = $qb->getQuery()->getResult(); - return array_map(fn(JobEntity $entity) => $this->mapper->toDomain($entity), $entities); + return array_map(fn (JobEntity $entity) => $this->mapper->toDomain($entity), $entities); } public function countByCriteria(array $criteria): int diff --git a/src/Domain/Shared/Infrastructure/Service/MangaFileManager.php b/src/Domain/Shared/Infrastructure/Service/MangaFileManager.php index 5c1e1c3..f107cd2 100644 --- a/src/Domain/Shared/Infrastructure/Service/MangaFileManager.php +++ b/src/Domain/Shared/Infrastructure/Service/MangaFileManager.php @@ -107,5 +107,3 @@ readonly class MangaFileManager implements MangaPathManagerInterface return $text ?: 'n-a'; } } - - diff --git a/src/Entity/User.php b/src/Entity/User.php index c4ed74e..6c33b9c 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -117,10 +117,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface */ public function getRoles(): array { - if($this->accessTokenScopes !== null){ + if ($this->accessTokenScopes !== null) { $roles = $this->roles; $roles[] = 'ROLE_FRONT_USER'; - }else{ + } else { $roles = $this->accessTokenScopes; } @@ -158,7 +158,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface public function eraseCredentials(): void { // If you store any temporary, sensitive data on the user, clear it here - $this->plainPassword = null; + $this->plainPassword = null; } public function getFirstName(): ?string diff --git a/src/MessageHandler/DownloadChapterHandler.php b/src/MessageHandler/DownloadChapterHandler.php index 0d96cb9..ba91a75 100644 --- a/src/MessageHandler/DownloadChapterHandler.php +++ b/src/MessageHandler/DownloadChapterHandler.php @@ -41,11 +41,11 @@ readonly class DownloadChapterHandler $preferredSources = $manga->getPreferredSources()->toArray(); $allSources = $this->contentSourceRepository->findAll(); - $filteredSources = array_udiff($allSources, $preferredSources, function ($a, $b) { - return $a->getId() - $b->getId(); - }); + $filteredSources = array_udiff($allSources, $preferredSources, function ($a, $b) { + return $a->getId() - $b->getId(); + }); - $sources = array_merge($preferredSources, $filteredSources); + $sources = array_merge($preferredSources, $filteredSources); if (count($preferredSources) > 0) { $sources = $preferredSources; diff --git a/src/Security/ApiTokenHandler.php b/src/Security/ApiTokenHandler.php index 8598955..45777f3 100644 --- a/src/Security/ApiTokenHandler.php +++ b/src/Security/ApiTokenHandler.php @@ -19,11 +19,11 @@ readonly class ApiTokenHandler implements AccessTokenHandlerInterface { $token = $this->apiTokenRepository->findOneBy(['token' => $accessToken]); - if(!$token) { + if (!$token) { throw new BadCredentialsException(); } - if(!$token->isValid()) { + if (!$token->isValid()) { throw new CustomUserMessageAuthenticationException('Token expired'); } diff --git a/src/Service/MangaScraperService.php b/src/Service/MangaScraperService.php index dbbcfbd..d68d3f7 100644 --- a/src/Service/MangaScraperService.php +++ b/src/Service/MangaScraperService.php @@ -21,7 +21,6 @@ use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; - use Symfony\Component\Panther\Client as PantherClient; class MangaScraperService @@ -524,8 +523,7 @@ class MangaScraperService // } throw new \Exception('Le contenu récupéré n\'est pas une image. Type de contenu : ' . $contentType); } - } catch - (RequestException $e) { + } catch (RequestException $e) { throw new \Exception('Erreur lors de la récupération de l\'image : ' . $e->getMessage()); } } diff --git a/src/State/UserHashPasswordProcessor.php b/src/State/UserHashPasswordProcessor.php index 56a5214..e70a1be 100644 --- a/src/State/UserHashPasswordProcessor.php +++ b/src/State/UserHashPasswordProcessor.php @@ -16,7 +16,7 @@ readonly class UserHashPasswordProcessor implements ProcessorInterface } public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): mixed { - if($data instanceof User && $data->getPlainPassword() !== null) { + if ($data instanceof User && $data->getPlainPassword() !== null) { $data->setPassword($this->passwordHasher->hashPassword($data, $data->getPlainPassword())); }