File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 11CHANGELOG
22=========
33
4+ 2.13.0
5+ -------------------
6+
7+ * The return types on the ` jsonSerialize ` implementations have been remove
8+ to that they do not conflict with ` JsonSerializable::jsonSerialize ` on PHP
9+ 8+. Reported by Gokul Hegde. GitHub #185 .
10+
4112.12.2 (2021-11-30)
512-------------------
613
Original file line number Diff line number Diff line change @@ -61,7 +61,13 @@ public function __isset(string $attr): bool
6161 return $ attr !== 'instance ' && isset ($ this ->{$ attr });
6262 }
6363
64- public function jsonSerialize (): array
64+ /**
65+ * @return mixed data that can be serialized by json_encode
66+ */
67+ // We don't specify a return type here as PHP 8 has "mixed" as the return
68+ // type for "JsonSerializable::jsonSerialize", but PHP 7 doesn't support
69+ // "mixed".
70+ public function jsonSerialize ()
6571 {
6672 return $ this ->raw ;
6773 }
Original file line number Diff line number Diff line change @@ -60,7 +60,13 @@ private function validAttribute(string $attr): bool
6060 return \in_array ($ attr , $ this ->validAttributes , true );
6161 }
6262
63- public function jsonSerialize (): ?array
63+ /**
64+ * @return mixed data that can be serialized by json_encode
65+ */
66+ // We don't specify a return type here as PHP 8 has "mixed" as the return
67+ // type for "JsonSerializable::jsonSerialize", but PHP 7 doesn't support
68+ // "mixed".
69+ public function jsonSerialize ()
6470 {
6571 return $ this ->record ;
6672 }
You can’t perform that action at this time.
0 commit comments