Skip to content

Commit

Permalink
[FIX] Add support for league/fractal v0.20 (#53)
Browse files Browse the repository at this point in the history
* Update league/fractal to ~0.20

* Match serializer to league/fractal
  • Loading branch information
ikari7789 authored Mar 14, 2022
1 parent 4e0a4e1 commit 41aeb78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
}
],
"require": {
"php": ">=5.6.0",
"league/fractal": "~0.17"
"php": ">=7.4",
"league/fractal": "~0.20"
},
"require-dev": {
"phpunit/phpunit": "~5.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($resourceKey, array $data)
public function collection(string $resourceKey, array $data): array
{
if (is_null($resourceKey)) $resourceKey = static::RESOURCE_KEY;
return $resourceKey ? [$resourceKey => $data]: $data;
Expand All @@ -35,7 +35,7 @@ public function collection($resourceKey, array $data)
*
* @return array
*/
public function item($resourceKey, array $data)
public function item(string $resourceKey, array $data): array
{
if (is_null($resourceKey)) $resourceKey = static::RESOURCE_KEY;
return $resourceKey ? [$resourceKey => $data]: $data;
Expand Down

0 comments on commit 41aeb78

Please sign in to comment.