function jsonSerialize() { return array_filter(get_object_vars($this), function ($item) { return !is_null($item); }); }