feat: migrer vers Symfony 8, PHP 8.4 et les dépendances majeures associées
- PHP 8.3 → 8.4 (Dockerfile + composer.json) - Symfony 7.0 → 8.0 (tous les composants symfony/*) - API Platform 3.x → 4.x : migration openapiContext → openapi: new Operation(...) - Doctrine DBAL 3 → 4 : suppression use_savepoints, replace prepare/executeQuery - Doctrine ORM 2.x → 3.x : ClassMetadataInfo → ClassMetadata, setParameters → setParameter - Doctrine Bundle 2.x → 3.x, Fixtures Bundle 3.x → 4.x - zenstruck/foundry 1.x → 2.x : ModelFactory → PersistentObjectFactory, getDefaults → defaults - phpmd/phpmd 2.x → 3.x-dev (seule version supportant Symfony 8) - phparkitect 0.3 → 0.8 : NotDependsOnTheseNamespaces prend un array - symfony/mercure-bundle 0.3 → 0.4, symfony/monolog-bundle 3 → 4 - Suppression de runtime/frankenphp-symfony (intégré nativement dans symfony/runtime 8) - worker.Caddyfile : suppression de APP_RUNTIME (détection automatique Symfony 8) - Routes errors.xml/wdt.xml/profiler.xml → .php (Symfony 8 supprime le XML) - Types::ARRAY → Types::JSON dans Entity/Manga.php (DBAL 4 retire array type) - Suppression de src/Schedule.php (doublon vide avec MonitoringSchedule) - Tests : hydra:Collection → Collection, hydra:member → member (API Platform 4)
This commit is contained in:
parent
5a0888eb28
commit
5ed303612a
@@ -13,7 +13,7 @@ readonly class DiscoverMangaHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
private MangaProviderInterface $mangaProvider
|
||||
private MangaProviderInterface $mangaProvider,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ readonly class DiscoverMangaHandler
|
||||
|
||||
$recommendations = array_values(array_filter(
|
||||
$collection->getItems(),
|
||||
fn (Manga $m) => $m->getExternalId() === null
|
||||
fn (Manga $m) => null === $m->getExternalId()
|
||||
|| !in_array($m->getExternalId()->getValue(), $ownedExternalIds, true)
|
||||
));
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ use App\Domain\Manga\Application\Response\DownloadResponse;
|
||||
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
|
||||
use App\Domain\Manga\Domain\Contract\Service\FileServiceInterface;
|
||||
use App\Domain\Manga\Domain\Exception\CbzFileNotFoundException;
|
||||
use App\Domain\Manga\Domain\Exception\ChapterNotFoundException;
|
||||
use App\Domain\Manga\Domain\Exception\ChapterNotAvailableException;
|
||||
use App\Domain\Manga\Domain\Exception\ChapterNotFoundException;
|
||||
use App\Domain\Shared\Domain\Contract\QueryHandlerInterface;
|
||||
use App\Domain\Shared\Domain\Contract\QueryInterface;
|
||||
use App\Domain\Shared\Domain\Contract\ResponseInterface;
|
||||
@@ -17,7 +17,7 @@ readonly class DownloadCbzHandler implements QueryHandlerInterface
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
private FileServiceInterface $fileService
|
||||
private FileServiceInterface $fileService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ readonly class DownloadVolumeHandler implements QueryHandlerInterface
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
private FileServiceInterface $fileService
|
||||
private FileServiceInterface $fileService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ readonly class FindMangaMatchByFilenameHandler
|
||||
{
|
||||
public function __construct(
|
||||
private FilenameAnalyzerInterface $filenameAnalyzer,
|
||||
private MangaRepositoryInterface $mangaRepository
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ readonly class FindMangaMatchByFilenameHandler
|
||||
|
||||
/**
|
||||
* Calcule un score de correspondance entre le manga et le titre recherché
|
||||
* Score plus élevé = meilleure correspondance
|
||||
* Score plus élevé = meilleure correspondance.
|
||||
*/
|
||||
private function calculateMatchScore(Manga $manga, string $searchedTitle): int
|
||||
{
|
||||
@@ -97,12 +97,12 @@ readonly class FindMangaMatchByFilenameHandler
|
||||
}
|
||||
|
||||
// Le titre du manga contient le terme recherché
|
||||
if (stripos($mangaTitle, $searchedTitle) !== false) {
|
||||
if (false !== stripos($mangaTitle, $searchedTitle)) {
|
||||
$score += 50;
|
||||
}
|
||||
|
||||
// Le terme recherché contient le titre du manga
|
||||
if (stripos($searchedTitle, $mangaTitle) !== false) {
|
||||
if (false !== stripos($searchedTitle, $mangaTitle)) {
|
||||
$score += 40;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Domain\Manga\Domain\Exception\MangaNotFoundException;
|
||||
readonly class GetMangaByIdHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Domain\Manga\Domain\Model\ValueObject\MangaSlug;
|
||||
readonly class GetMangaBySlugHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ use App\Domain\Manga\Domain\Model\Chapter;
|
||||
readonly class GetMangaChaptersHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ readonly class GetMangaChaptersHandler
|
||||
|
||||
$grouped = $this->groupChapters($allChapters);
|
||||
|
||||
if ($query->sortOrder === 'desc') {
|
||||
if ('desc' === $query->sortOrder) {
|
||||
usort($grouped, fn (ChapterResponse $a, ChapterResponse $b) => $b->number <=> $a->number);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ readonly class GetMangaChaptersHandler
|
||||
$pagesDir = $chapter->getPagesDirectory();
|
||||
$volume = $chapter->getVolume();
|
||||
|
||||
if ($pagesDir !== null && $volume !== null) {
|
||||
if (null !== $pagesDir && null !== $volume) {
|
||||
if ($pagesDir === $currentPagesDir && $volume === $currentVolume) {
|
||||
$currentGroup[] = $chapter;
|
||||
} else {
|
||||
@@ -104,7 +104,7 @@ readonly class GetMangaChaptersHandler
|
||||
$max = max($numbers);
|
||||
|
||||
$fmt = fn (float $n) => $n == (int) $n ? (string) (int) $n : (string) $n;
|
||||
$range = count($group) > 1 ? $fmt($min) . '-' . $fmt($max) : $fmt($min);
|
||||
$range = count($group) > 1 ? $fmt($min).'-'.$fmt($max) : $fmt($min);
|
||||
|
||||
return new ChapterResponse(
|
||||
id: $first->getId(),
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
namespace App\Domain\Manga\Application\QueryHandler;
|
||||
|
||||
use App\Domain\Manga\Application\Query\GetMangaList;
|
||||
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
|
||||
use App\Domain\Manga\Application\Response\MangaListResponse;
|
||||
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
|
||||
|
||||
readonly class GetMangaListHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $mangaRepository
|
||||
private MangaRepositoryInterface $mangaRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ readonly class GetMangaListHandler
|
||||
foreach ($mangas as $manga) {
|
||||
$id = $manga->getId()->getValue();
|
||||
$chapterCounts[$id] = [
|
||||
'total' => $this->mangaRepository->countChapters($id),
|
||||
'total' => $this->mangaRepository->countChapters($id),
|
||||
'scraped' => $this->mangaRepository->countAvailableChapters($id),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Domain\Manga\Domain\Model\Manga;
|
||||
readonly class SearchLocalMangaHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaRepositoryInterface $repository
|
||||
private MangaRepositoryInterface $repository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Domain\Manga\Domain\Model\Manga;
|
||||
readonly class SearchMangaHandler
|
||||
{
|
||||
public function __construct(
|
||||
private MangaProviderInterface $mangaProvider
|
||||
private MangaProviderInterface $mangaProvider,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ readonly class SearchMangaHandler
|
||||
{
|
||||
$mangaCollection = $this->mangaProvider->search($query->title);
|
||||
|
||||
|
||||
return new MangaSearchResponse(
|
||||
array_map(
|
||||
fn (Manga $manga, int $index) => new MangaSearchItem(
|
||||
|
||||
Reference in New Issue
Block a user