From 3d09b61db5ec19be187eff02ab5a610ea17d650d Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:05:11 +0700 Subject: [PATCH] fix(`PagerItem`): `withPageNumber` should return static --- CHANGELOG.md | 4 ++++ packages/rekapager-contracts/src/PageInterface.php | 5 +---- packages/rekapager-core/src/Pager/Internal/PagerItem.php | 5 +---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 923cf63..b30e936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +# 0.12.0 + +* fix(`PagerItem`): `withPageNumber` should return static + # 0.11.2 * fix: add interface covariance where applicable diff --git a/packages/rekapager-contracts/src/PageInterface.php b/packages/rekapager-contracts/src/PageInterface.php index a46b72b..c266107 100644 --- a/packages/rekapager-contracts/src/PageInterface.php +++ b/packages/rekapager-contracts/src/PageInterface.php @@ -37,10 +37,7 @@ public function getPageIdentifier(): object; */ public function getPageNumber(): ?int; - /** - * @return self - */ - public function withPageNumber(?int $pageNumber): self; + public function withPageNumber(?int $pageNumber): static; /** * @return PageableInterface diff --git a/packages/rekapager-core/src/Pager/Internal/PagerItem.php b/packages/rekapager-core/src/Pager/Internal/PagerItem.php index 8e21353..75fbc27 100644 --- a/packages/rekapager-core/src/Pager/Internal/PagerItem.php +++ b/packages/rekapager-core/src/Pager/Internal/PagerItem.php @@ -43,10 +43,7 @@ public function __construct( $this->pageNumber = new NullPageNumber(); } - /** - * @return self - */ - public function withPageNumber(?int $pageNumber): self + public function withPageNumber(?int $pageNumber): static { return new self( wrapped: $this->wrapped->withPageNumber($pageNumber),