File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 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
384384
385385 public function jsonSerialize (): ?array
386386 {
387- if ($ this ->isEmpty () ) {
387+ if ($ this ->data === [] ) {
388388 return null ;
389389 }
390390
Original file line number Diff line number Diff line change @@ -183,4 +183,9 @@ public function join(string $separator = ''): string;
183183 * @throws RuntimeException if a new key is being generated more than once.
184184 */
185185 public function keyExchange (callable $ keyGenerator ): MapInterface ;
186+
187+ /**
188+ * @psalm-return non-empty-array<TKey,TValue>|null
189+ */
190+ public function jsonSerialize (): ?array ;
186191}
Original file line number Diff line number Diff line change @@ -150,4 +150,9 @@ public function join(string $separator = ''): string;
150150 * @psalm-return list<TValue>
151151 */
152152 public function toNativeArray (): array ;
153+
154+ /**
155+ * @psalm-return list<TValue>
156+ */
157+ public function jsonSerialize (): array ;
153158}
You can’t perform that action at this time.
0 commit comments