Skip to content

Commit 440a9ba

Browse files
committed
Merge branch 'update-fractal' into main
2 parents 9967ee9 + 78e9206 commit 440a9ba

File tree

5 files changed

+28
-22
lines changed

5 files changed

+28
-22
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes for Element API
22

3+
## Unreleased
4+
5+
- Updated Fractal to 0.20. ([#183](https://github.com/craftcms/element-api/pull/183))
6+
37
## 3.0.1.1 - 2022-07-07
48

59
### Fixed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"prefer-stable": true,
2828
"require": {
2929
"craftcms/cms": "^4.0.0-RC3",
30-
"league/fractal": "^0.18.0"
30+
"league/fractal": "^0.20.1"
3131
},
3232
"require-dev": {
3333
"craftcms/ecs": "dev-main",

composer.lock

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)