<?php

namespace App\Domain\Scraping\Domain\Model\ValueObject;

class PageNumber
{
    public function __construct(
        private readonly int $number
    ) {
        if ($number < 1) {
            throw new \InvalidArgumentException('Page number must be greater than 0');
        }
    }

    public function getValue(): int
    {
        return $this->number;
    }

    public function getFormattedNumber(): string
    {
        return sprintf('%03d', $this->number);
    }
}
