diff --git a/src/JsonFeedV1Serializer.php b/src/JsonFeedV1Serializer.php index 746c395..f48072e 100644 --- a/src/JsonFeedV1Serializer.php +++ b/src/JsonFeedV1Serializer.php @@ -17,7 +17,7 @@ class JsonFeedV1Serializer extends ArraySerializer /** * @inheritdoc */ - public function collection($resourceKey, array $data) + public function collection($resourceKey, array $data): array { return ['items' => $data]; } @@ -25,7 +25,7 @@ public function collection($resourceKey, array $data) /** * @inheritdoc */ - public function meta(array $meta) + public function meta(array $meta): array { return array_merge([ 'version' => 'https://jsonfeed.org/version/1.1', @@ -38,7 +38,7 @@ public function meta(array $meta) /** * @inheritdoc */ - public function paginator(PaginatorInterface $paginator) + public function paginator(PaginatorInterface $paginator): array { $currentPage = (int)$paginator->getCurrentPage(); $lastPage = (int)$paginator->getLastPage(); diff --git a/src/PaginatorAdapter.php b/src/PaginatorAdapter.php index 3533250..236a7b4 100644 --- a/src/PaginatorAdapter.php +++ b/src/PaginatorAdapter.php @@ -65,7 +65,7 @@ public function __construct($elementsPerPage, $totalElements, $pageParam) * * @return int */ - public function getCurrentPage() + public function getCurrentPage(): int { return $this->currentPage; } @@ -75,7 +75,7 @@ public function getCurrentPage() * * @return int */ - public function getLastPage() + public function getLastPage(): int { return $this->totalPages; } @@ -85,7 +85,7 @@ public function getLastPage() * * @return int */ - public function getTotal() + public function getTotal(): int { return $this->totalElements; } @@ -95,7 +95,7 @@ public function getTotal() * * @return int */ - public function getCount() + public function getCount(): int { return $this->count; } @@ -115,7 +115,7 @@ public function setCount($count) * * @return int */ - public function getPerPage() + public function getPerPage(): int { return $this->elementsPerPage; } @@ -126,7 +126,7 @@ public function getPerPage() * @param int $page * @return string */ - public function getUrl($page) + public function getUrl($page): string { $request = Craft::$app->getRequest();