From 2dc92244d47cf7281d5c70bfcef324edbd9e8150 Mon Sep 17 00:00:00 2001 From: Lukas Sarfert Date: Wed, 29 May 2024 13:11:52 +0200 Subject: [PATCH 1/2] update for compatibility with php 8.3 --- composer.json | 2 +- src/JsonApiError.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f263f2f..86d1ef9 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": ">=7.1.0", "ext-json": "*", - "league/fractal": "^0.19.2", + "league/fractal": "^0.20.0", "yiisoft/yii2": "~2.0.15" }, diff --git a/src/JsonApiError.php b/src/JsonApiError.php index b8e8d75..b3022bc 100644 --- a/src/JsonApiError.php +++ b/src/JsonApiError.php @@ -21,6 +21,7 @@ class JsonApiError extends BaseObject implements JsonSerializable public $source; public $meta = []; + #[\ReturnTypeWillChange] public function jsonSerialize() { $base = [ From 0aa15e99ace03da7ebed1ac5a8e044444aaef69e Mon Sep 17 00:00:00 2001 From: Lukas Sarfert Date: Wed, 29 May 2024 14:59:31 +0200 Subject: [PATCH 2/2] update for compatibility with php 8.3 --- src/pagination/JsonApiPaginator.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pagination/JsonApiPaginator.php b/src/pagination/JsonApiPaginator.php index 93111df..85b9a39 100644 --- a/src/pagination/JsonApiPaginator.php +++ b/src/pagination/JsonApiPaginator.php @@ -53,12 +53,12 @@ class JsonApiPaginator extends Pagination implements PaginatorInterface /** * @var boolean * Indicate, should paginator provide absolute urls or relative - */ + */ public $absoluteUrls = true; /** * @var int calculated current page number - */ + */ private $_page; public function init() @@ -68,32 +68,32 @@ public function init() $this->pageParam = 'number'; } - public function getCurrentPage() + public function getCurrentPage(): int { return $this->getPage(); } - public function getLastPage() + public function getLastPage(): int { return $this->getPageCount(); } - public function getTotal() + public function getTotal(): int { return $this->totalCount; } - public function getCount() + public function getCount(): int { return $this->itemsCount; } - public function getPerPage() + public function getPerPage(): int { return $this->getPageSize(); } - public function getUrl($page) + public function getUrl($page): string { return $this->createUrl($page); }