Files
Mangarr/src/Domain/Manga/Application/Response/ChapterListResponse.php
ext.jeremy.guillot@maxicoffee.domains 7506a7a3c1 style: apply php-cs-fixer formatting (PSR-12)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 20:46:59 +01:00

30 lines
559 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;
}
}