*/ private array $codes; /** * @param list $codes */ public function __construct(array $codes, private readonly ?string $cursor = null) { $this->codes = $codes; } /** * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize(): array { $out = ['codes' => $this->codes]; if ($this->cursor !== null) { $out['cursor'] = $this->cursor; } return $out; } }