Missing array typehints
Refactor: extract EntityMetadata and MetadataDriverInterface.