| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | final class Page implements PageInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var int |
||
| 11 | */ |
||
| 12 | private $pageNumber; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var int |
||
| 16 | */ |
||
| 17 | private $nbItems; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Page constructor. |
||
| 21 | * @param int $pageNumber |
||
| 22 | * @param int $nbItems |
||
| 23 | */ |
||
| 24 | public function __construct(int $pageNumber, int $nbItems = 0) |
||
| 25 | { |
||
| 26 | $this->pageNumber = max(0, $pageNumber); |
||
| 27 | $this->nbItems = max(0, $nbItems); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function getPageNumber(): int |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @inheritDoc |
||
| 40 | */ |
||
| 41 | public function count(): int |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @inheritDoc |
||
| 48 | */ |
||
| 49 | public function __toString(): string |
||
| 54 |