diff --git a/composer.json b/composer.json index 921fb70..7be3a75 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "php": "^8.0.2", "craftcms/cms": "^4.3.5", "algolia/algoliasearch-client-php": "^2.3|^3.0", - "league/fractal": "^0.18|^0.19" + "league/fractal": "^0.20" }, "repositories": [ { diff --git a/src/ScoutIndex.php b/src/ScoutIndex.php index 4692e46..6735930 100644 --- a/src/ScoutIndex.php +++ b/src/ScoutIndex.php @@ -21,7 +21,7 @@ class ScoutIndex extends BaseObject /** @var IndexSettings */ public $indexSettings; - /** @var string */ + /** @var */ public $elementType = Entry::class; /** @var callable|string|array|\League\Fractal\TransformerAbstract */ diff --git a/src/serializer/AlgoliaSerializer.php b/src/serializer/AlgoliaSerializer.php index 1464a6a..99cc0ff 100644 --- a/src/serializer/AlgoliaSerializer.php +++ b/src/serializer/AlgoliaSerializer.php @@ -7,12 +7,12 @@ class AlgoliaSerializer extends \League\Fractal\Serializer\ArraySerializer /** * Serialize a collection. * - * @param string $resourceKey + * @param ?string $resourceKey * @param array $data * * @return array */ - public function collection($resourceKey, array $data) + public function collection(?string $resourceKey, array $data): array { if ($resourceKey) { return [$resourceKey => $data];