hydrateAdditionalProperty.php
Table of Contents
Functions
- hydrateAdditionalProperty() : array<string|int, PropertyValue>|mixed|null
- Hydrate an array of PropertyValue objects.
Functions
hydrateAdditionalProperty()
Hydrate an array of PropertyValue objects.
hydrateAdditionalProperty([mixed $properties = null ]) : array<string|int, PropertyValue>|mixed|null
Anything that is not an array is handed back untouched — a lone
PropertyValue is a legal shape of the additionalProperty property,
and this helper is not the place to reject it. An array that is not an
indexed, non-empty list yields null, so a caller can tell "nothing to
hydrate" from a result.
🔑 A bare reference survives inside a list, exactly as it does on its own : a list of unresolved handles comes back as it stands, and only an entry that was an array and resolved to nothing is dropped. The keys stay gap-free — a filtered list left with holes serializes as a JSON object, and a consumer walking the value gets something it cannot walk.
Parameters
- $properties : mixed = null
-
An indexed array of PropertyValue definitions, or any value to pass through.