feat: analyse import + all tests fixed
This commit is contained in:
parent
fbe9619224
commit
3170a7c60e
21
src/Domain/Manga/Application/Response/MangaMatchItem.php
Normal file
21
src/Domain/Manga/Application/Response/MangaMatchItem.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Manga\Application\Response;
|
||||
|
||||
readonly class MangaMatchItem
|
||||
{
|
||||
public function __construct(
|
||||
public string $id,
|
||||
public string $title,
|
||||
public string $slug,
|
||||
public array $alternativeSlugs,
|
||||
public ?string $thumbnailUrl,
|
||||
public int $matchScore,
|
||||
public ?float $chapterNumber = null,
|
||||
public ?float $volumeNumber = null
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
30
src/Domain/Manga/Application/Response/MangaMatchResponse.php
Normal file
30
src/Domain/Manga/Application/Response/MangaMatchResponse.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Manga\Application\Response;
|
||||
|
||||
readonly class MangaMatchResponse
|
||||
{
|
||||
/**
|
||||
* @param MangaMatchItem[] $matches
|
||||
*/
|
||||
public function __construct(
|
||||
public array $matches,
|
||||
public ?float $chapterNumber,
|
||||
public ?float $volumeNumber,
|
||||
public array $possibleTitles
|
||||
) {
|
||||
}
|
||||
|
||||
public function hasMatches(): bool
|
||||
{
|
||||
return count($this->matches) > 0;
|
||||
}
|
||||
|
||||
public function getBestMatch(): ?MangaMatchItem
|
||||
{
|
||||
return $this->matches[0] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user