diff --git a/composer.json b/composer.json index 588e34e..87159a7 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/Serializer/Serializer.php b/src/Serializer/Serializer.php index c9035b9..690e087 100644 --- a/src/Serializer/Serializer.php +++ b/src/Serializer/Serializer.php @@ -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; @@ -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;