Currently, Importer::canImport() accepts a Field and a format name string. However, there are cases where we want to know more about the Deformatter, such as if its source value is an array that we can type introspect.
For 2.x, we should change the API to pass the full Deformatter to canImport().
That will also allow us to add an ArrayBased marker interface to the Array, CSV, JSON, YAML, and TOML Deformatters for canImport() to check if needed.
See the notes in MixedField and UnionField for an example of where we want that.
Currently,
Importer::canImport()accepts a Field and a format name string. However, there are cases where we want to know more about the Deformatter, such as if its source value is an array that we can type introspect.For 2.x, we should change the API to pass the full Deformatter to
canImport().That will also allow us to add an
ArrayBasedmarker interface to the Array, CSV, JSON, YAML, and TOML Deformatters forcanImport()to check if needed.See the notes in
MixedFieldandUnionFieldfor an example of where we want that.