diff --git a/src/Support/Serializers/ArraySerializer.php b/src/Support/Serializers/ArraySerializer.php index 992c4c0..948c9cb 100644 --- a/src/Support/Serializers/ArraySerializer.php +++ b/src/Support/Serializers/ArraySerializer.php @@ -20,11 +20,11 @@ class ArraySerializer extends FractalArraySerializer /** * Serialize a collection. * - * @param string $resourceKey + * @param string|null $resourceKey * @param array $data * @return array */ - public function collection($resourceKey, array $data) + public function collection(?string $resourceKey, array $data):array { $paginationDataField = Config::get('response.format.fields.data.fields.data.alias', 'data'); @@ -37,7 +37,7 @@ public function collection($resourceKey, array $data) * @param PaginatorInterface $paginator * @return array */ - public function paginator(PaginatorInterface $paginator) + public function paginator(PaginatorInterface $paginator): array { $currentPage = (int) $paginator->getCurrentPage(); $lastPage = (int) $paginator->getLastPage(); diff --git a/src/Support/Serializers/SimpleArraySerializer.php b/src/Support/Serializers/SimpleArraySerializer.php index 9c6e466..1a3bb0b 100644 --- a/src/Support/Serializers/SimpleArraySerializer.php +++ b/src/Support/Serializers/SimpleArraySerializer.php @@ -16,11 +16,11 @@ class SimpleArraySerializer extends ArraySerializer /** * Serialize a collection. * - * @param string $resourceKey + * @param string|null $resourceKey * @param array $data * @return array */ - public function collection($resourceKey, array $data) + public function collection(?string $resourceKey, array $data):array { return $data; }