Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: upgrade league/fractal to 0.20 #292

Merged
merged 1 commit into from Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
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"
},
"repositories": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/ScoutIndex.php
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
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