Skip to content

Commit

Permalink
Missing return types
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Mar 11, 2024
1 parent 138363a commit f2343b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/JsonFeedV1Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class JsonFeedV1Serializer extends ArraySerializer
/**
* @inheritdoc
*/
public function collection($resourceKey, array $data)
public function collection($resourceKey, array $data): array
{
return ['items' => $data];
}

/**
* @inheritdoc
*/
public function meta(array $meta)
public function meta(array $meta): array
{
return array_merge([
'version' => 'https://jsonfeed.org/version/1.1',
Expand All @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions src/PaginatorAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct($elementsPerPage, $totalElements, $pageParam)
*
* @return int
*/
public function getCurrentPage()
public function getCurrentPage(): int
{
return $this->currentPage;
}
Expand All @@ -75,7 +75,7 @@ public function getCurrentPage()
*
* @return int
*/
public function getLastPage()
public function getLastPage(): int
{
return $this->totalPages;
}
Expand All @@ -85,7 +85,7 @@ public function getLastPage()
*
* @return int
*/
public function getTotal()
public function getTotal(): int
{
return $this->totalElements;
}
Expand All @@ -95,7 +95,7 @@ public function getTotal()
*
* @return int
*/
public function getCount()
public function getCount(): int
{
return $this->count;
}
Expand All @@ -115,7 +115,7 @@ public function setCount($count)
*
* @return int
*/
public function getPerPage()
public function getPerPage(): int
{
return $this->elementsPerPage;
}
Expand All @@ -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();

Expand Down

0 comments on commit f2343b4

Please sign in to comment.