ParserOutput::setSections() currently takes a untyped array as argument. It should instead take something like an array<SectionMetadata> to provide stronger typing on the value and structure (where SectionMetadata is a value object).
Probably add something like ::setSectionMetadata(...new type...) and then have ::getSections() return $this->sectionMetadata->getLegacyArray() and also use the legacy array in the serialization for back compat.