spatie / fractalistic

A framework agnostic, developer friendly wrapper around Fractal
https://freek.dev/644-a-developer-friendly-wrapper-around-fractal
MIT License
382 stars 32 forks source link

Exception in ArraySerializer #57

Closed CinexUA closed 2 years ago

CinexUA commented 2 years ago

I got an exception in ArraySerializer. For ex.: "local.ERROR: Declaration of Spatie\Fractalistic\ArraySerializer::collection(string $resourceKey, array $data): array must be compatible with League\Fractal\Serializer\ArraySerializer::collection(?string $resourceKey, array $data): array"

In the collection method, you need to add question mark before: "string $resourceKey" which invoke the exception, because the method changed in "League\Fractal\Serializer\ArraySerializer" To fix it, you need to add a question mark: public function collection(?string $resourceKey, array $data): array in

screen_1.jpg screen_2.jpg screen_3.jpg screen_4.jpg

freekmurze commented 2 years ago

Duplicate of #56