Skip to content

Commit

Permalink
Fix jsonSerialize on PHP 8.1+ (#71)
Browse files Browse the repository at this point in the history
* Fix jsonSerialize on PHP 8.1+

```
During inheritance of JsonSerializable: Uncaught ErrorException: Return type of FlixTech\SchemaRegistryApi\Schema\AvroReference::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
```

* Use ReturnTypeWillChange to be PHP 7 compatible
  • Loading branch information
BafS authored Aug 24, 2022
1 parent 471c310 commit 8981711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Schema/AvroReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ final class AvroReference implements \JsonSerializable
*/
private $name;


/**
* @var string
*/
Expand All @@ -37,6 +36,7 @@ public function __construct(AvroName $name, string $subject, $version)
$this->version = $version;
}

#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down

0 comments on commit 8981711

Please sign in to comment.