Files
Mangarr/src/Domain/Manga/Application/Response/ChapterListResponse.php
ext.jeremy.guillot@maxicoffee.domains 6667cc224b feat: GetChapters endpoint + tests
2025-02-10 20:07:24 +01:00

28 lines
554 B
PHP

<?php
namespace App\Domain\Manga\Application\Response;
readonly class ChapterListResponse
{
public function __construct(
public array $chapters,
public int $total,
public int $page,
public int $limit
) {}
public function getTotalPages(): int
{
return (int) ceil($this->total / $this->limit);
}
public function hasNextPage(): bool
{
return $this->page < $this->getTotalPages();
}
public function hasPreviousPage(): bool
{
return $this->page > 1;
}
}