File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ public function slice(int $length): MapInterface
384
384
385
385
public function jsonSerialize (): ?array
386
386
{
387
- if ($ this ->isEmpty () ) {
387
+ if ($ this ->data === [] ) {
388
388
return null ;
389
389
}
390
390
Original file line number Diff line number Diff line change @@ -183,4 +183,9 @@ public function join(string $separator = ''): string;
183
183
* @throws RuntimeException if a new key is being generated more than once.
184
184
*/
185
185
public function keyExchange (callable $ keyGenerator ): MapInterface ;
186
+
187
+ /**
188
+ * @psalm-return non-empty-array<TKey,TValue>|null
189
+ */
190
+ public function jsonSerialize (): ?array ;
186
191
}
Original file line number Diff line number Diff line change @@ -150,4 +150,9 @@ public function join(string $separator = ''): string;
150
150
* @psalm-return list<TValue>
151
151
*/
152
152
public function toNativeArray (): array ;
153
+
154
+ /**
155
+ * @psalm-return list<TValue>
156
+ */
157
+ public function jsonSerialize (): array ;
153
158
}
You can’t perform that action at this time.
0 commit comments