Skip to content

Commit f2343b4

Browse files
committed
Missing return types
1 parent 138363a commit f2343b4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/JsonFeedV1Serializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ class JsonFeedV1Serializer extends ArraySerializer
1717
/**
1818
* @inheritdoc
1919
*/
20-
public function collection($resourceKey, array $data)
20+
public function collection($resourceKey, array $data): array
2121
{
2222
return ['items' => $data];
2323
}
2424

2525
/**
2626
* @inheritdoc
2727
*/
28-
public function meta(array $meta)
28+
public function meta(array $meta): array
2929
{
3030
return array_merge([
3131
'version' => 'https://jsonfeed.org/version/1.1',
@@ -38,7 +38,7 @@ public function meta(array $meta)
3838
/**
3939
* @inheritdoc
4040
*/
41-
public function paginator(PaginatorInterface $paginator)
41+
public function paginator(PaginatorInterface $paginator): array
4242
{
4343
$currentPage = (int)$paginator->getCurrentPage();
4444
$lastPage = (int)$paginator->getLastPage();

src/PaginatorAdapter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct($elementsPerPage, $totalElements, $pageParam)
6565
*
6666
* @return int
6767
*/
68-
public function getCurrentPage()
68+
public function getCurrentPage(): int
6969
{
7070
return $this->currentPage;
7171
}
@@ -75,7 +75,7 @@ public function getCurrentPage()
7575
*
7676
* @return int
7777
*/
78-
public function getLastPage()
78+
public function getLastPage(): int
7979
{
8080
return $this->totalPages;
8181
}
@@ -85,7 +85,7 @@ public function getLastPage()
8585
*
8686
* @return int
8787
*/
88-
public function getTotal()
88+
public function getTotal(): int
8989
{
9090
return $this->totalElements;
9191
}
@@ -95,7 +95,7 @@ public function getTotal()
9595
*
9696
* @return int
9797
*/
98-
public function getCount()
98+
public function getCount(): int
9999
{
100100
return $this->count;
101101
}
@@ -115,7 +115,7 @@ public function setCount($count)
115115
*
116116
* @return int
117117
*/
118-
public function getPerPage()
118+
public function getPerPage(): int
119119
{
120120
return $this->elementsPerPage;
121121
}
@@ -126,7 +126,7 @@ public function getPerPage()
126126
* @param int $page
127127
* @return string
128128
*/
129-
public function getUrl($page)
129+
public function getUrl($page): string
130130
{
131131
$request = Craft::$app->getRequest();
132132

0 commit comments

Comments
 (0)