Configures whether an empty array should be transformed to an object (in JSON: {}) or to a list (in JSON: []).
public function withEmptyArrayAsObject(?bool $emptyArrayAsObject) : static { return $this->with(Serializer::EMPTY_ARRAY_AS_OBJECT, $emptyArrayAsObject); }