Skip to content

Commit 8981711

Browse files
authored
Fix jsonSerialize on PHP 8.1+ (#71)
* 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
1 parent 471c310 commit 8981711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Schema/AvroReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ final class AvroReference implements \JsonSerializable
1313
*/
1414
private $name;
1515

16-
1716
/**
1817
* @var string
1918
*/
@@ -37,6 +36,7 @@ public function __construct(AvroName $name, string $subject, $version)
3736
$this->version = $version;
3837
}
3938

39+
#[\ReturnTypeWillChange]
4040
public function jsonSerialize()
4141
{
4242
return [

0 commit comments

Comments
 (0)