3 namespace BookStack\Exports\ZipExportModels;
7 abstract class ZipExportModel implements JsonSerializable
10 * Handle the serialization to JSON.
11 * For these exports, we filter out optional (represented as nullable) fields
12 * just to clean things up and prevent confusion to avoid null states in the
13 * resulting export format itself.
15 public function jsonSerialize(): array
17 $publicProps = get_object_vars(...)->__invoke($this);
18 return array_filter($publicProps, fn ($value) => $value !== null);