thephpleague / fractal

Output complex, flexible, AJAX/RESTful data structures.
fractal.thephpleague.com
MIT License
3.52k stars 352 forks source link

Update version 0.19.2 -> 0.19.3 #557

Open beeyev opened 2 years ago

beeyev commented 2 years ago

Could you please make a bugfix update of the version 0.19.2

In order to fix this warning in PHP 8.1

Return type of League\Fractal\Scope::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vendor/league/fractal/src/Scope.php on line 298  

We need to add the mentioned attribute:

https://github.com/thephpleague/fractal/blob/0.19.2/src/Scope.php#L298

/**
 * @return array
 */
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
    return $this->toArray();
}

There are some breaking changes in 0.20, so I can't just swap the version to the new one.