mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 12:37:15 +00:00
bug #3536 Add ReturnTypeWillChange to JsonSerializable implementation (derrabus)
This PR was merged into the 2.x branch.
Discussion
----------
Add ReturnTypeWillChange to JsonSerializable implementation
On PHP 8.1, implementations of `JsonSerializable` should declare a return type.
In order to avoid a deprecation warning and maintain backwards compatibility, I've added the `ReturnTypeWillChange` attribute to declare that our implementation will add the necessary return type in a future release.
Commits
-------
507f78d9 Add ReturnTypeWillChange to JsonSerializable implementation
This commit is contained in:
@@ -40,6 +40,7 @@ class Markup implements \Countable, \JsonSerializable
|
||||
return mb_strlen($this->content, $this->charset);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return $this->content;
|
||||
|
||||
Reference in New Issue
Block a user