Skip to content

Commit

Permalink
Merge pull request #292 from qrazi/feat/update_fractal
Browse files Browse the repository at this point in the history
feat!: upgrade `league/fractal` to 0.20
  • Loading branch information
janhenckens authored Mar 18, 2024
2 parents 48baab8 + 3c11e78 commit 8ebd2b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
"conflict": {
"craftcms/element-api": ">=4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/ScoutIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ScoutIndex extends BaseObject
/** @var IndexSettings */
public $indexSettings;

/** @var string */
/** @var <class-string> */
public $elementType = Entry::class;

/** @var callable|string|array|\League\Fractal\TransformerAbstract */
Expand Down
4 changes: 2 additions & 2 deletions src/serializer/AlgoliaSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 8ebd2b9

Please sign in to comment.