Skip to content

Commit

Permalink
[FIX] Support fractal 0.20.1 (#55)
Browse files Browse the repository at this point in the history
* Update league/fractal to ~0.20

* Match serializer to league/fractal

* Set minimum fractal version to v0.20.1

Match method signatures in Serializer.
  • Loading branch information
andrew-miller-rakuten authored Apr 14, 2022
1 parent c45d21a commit f2a5e7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"require": {
"php": ">=7.4",
"league/fractal": "~0.20"
"league/fractal": "~0.20.1"
},
"require-dev": {
"phpunit/phpunit": "~9.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Serializer/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Serializer extends ArraySerializer
*
* @return array
*/
public function collection(string $resourceKey, array $data): array
public function collection(?string $resourceKey, array $data): array
{
if (empty($resourceKey)) {
$resourceKey = static::RESOURCE_KEY;
Expand All @@ -37,7 +37,7 @@ public function collection(string $resourceKey, array $data): array
*
* @return array
*/
public function item(string $resourceKey, array $data): array
public function item(?string $resourceKey, array $data): array
{
if (empty($resourceKey)) {
$resourceKey = static::RESOURCE_KEY;
Expand Down

0 comments on commit f2a5e7d

Please sign in to comment.