Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Split from #2002134: Move TypedData metadata introspection from data objects to definition objects :
DataDefinition::$definition is puzzling:
In most places Object::$definition is "the definition of the object", so here it feels like "the definition of the definition", which makes terrifying recursive mental knots :-p
This results in code like:
class ListDataDefinition {
public function __construct(array $definition = array(), DataDefinitionInterface $item_definition = NULL) {
$this->definition = $definition;
$this->itemDefinition = $item_definition;
}
$definition as array / $item_definition as DataDefinitionInterface is confusing.
We should try to find a better name for the "variable holding the internal values of a DataDefinition object".
Comments
Comment #1
yched CreditAttribution: yched commentedComment #2
fago#2002134: Move TypedData metadata introspection from data objects to definition objects already goes with $values there, thus closing. Please re-open if you don't think this is a good name.
Comment #3
yched CreditAttribution: yched commentedI think $values is fine - just wondering if the internal property should be renamed accordingly (we still have $this->definition as array and $this->itemDefinition as Definition)