diff --git a/core/lib/Drupal/Core/Config/ConfigBase.php b/core/lib/Drupal/Core/Config/ConfigBase.php index 37e0d80..24e3ed4 100644 --- a/core/lib/Drupal/Core/Config/ConfigBase.php +++ b/core/lib/Drupal/Core/Config/ConfigBase.php @@ -171,7 +171,7 @@ public function setData(array $data) { } /** - * Validate all keys in a passed in config array structure. + * Validates all keys in a passed in config array structure. * * @param array $data * Configuration array structure. diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index 3dbdd11..2e674cf 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -247,12 +247,13 @@ protected function doSave($id, EntityInterface $entity) { } /** - * Map an entity to its storage form as needed in this storage. + * Maps from an entity object to the storage record. * * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity to be written to configuration. + * The entity object. + * * @return array - * Record array with all modifications for this storage. + * The record to store. */ protected function mapToStorageRecord(EntityInterface $entity) { return $entity->toArray(); diff --git a/core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php b/core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php index 9364eaf..a81c3b1 100644 --- a/core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php +++ b/core/lib/Drupal/Core/Field/FieldTypePluginManagerInterface.php @@ -49,7 +49,7 @@ public function getDefaultSettings($type); public function getUiDefinitions(); /** - * Returns the plugin class for a field type. + * Returns the PHP class that implements the field type plugin. * * @param string $type * A field type name. diff --git a/core/modules/field/src/Entity/FieldInstanceConfig.php b/core/modules/field/src/Entity/FieldInstanceConfig.php index 0c1db07..68020a4 100644 --- a/core/modules/field/src/Entity/FieldInstanceConfig.php +++ b/core/modules/field/src/Entity/FieldInstanceConfig.php @@ -254,7 +254,7 @@ public function __construct(array $values, $entity_type = 'field_instance_config } // Discard the 'field_type' entry that is added in config records to ease - // schema generation and data altering for storage. + // schema generation and settings mapping from storage. // @see Drupal\field\Entity\FieldInstanceConfig::toArray(). unset($values['field_type']); @@ -290,7 +290,7 @@ public function toArray() { $properties = parent::toArray(); // Additionally, include the field type, that is needed to be able to // generate the field-type-dependant parts of the config schema and to - // allow for altering data by field type. + // allow for mapping settings from storage by field type. $properties['field_type'] = $this->getType(); return $properties; diff --git a/core/modules/field/src/FieldInstanceConfigStorage.php b/core/modules/field/src/FieldInstanceConfigStorage.php index ba6d96c..1e14c39 100644 --- a/core/modules/field/src/FieldInstanceConfigStorage.php +++ b/core/modules/field/src/FieldInstanceConfigStorage.php @@ -192,10 +192,9 @@ public function loadByProperties(array $conditions = array()) { * {@inheritdoc} */ protected function mapFromStorageRecords(array $records) { - foreach ($records as $key => $record) { + foreach ($records as &$record) { $class = $this->fieldTypeManager->getPluginClass($record['field_type']); $record['settings'] = $class::instanceSettingsFromConfigData($record['settings']); - $records[$key] = $record; } return parent::mapFromStorageRecords($records); } diff --git a/core/modules/field/src/FieldStorageConfigStorage.php b/core/modules/field/src/FieldStorageConfigStorage.php index d5c845b..cb89040 100644 --- a/core/modules/field/src/FieldStorageConfigStorage.php +++ b/core/modules/field/src/FieldStorageConfigStorage.php @@ -172,10 +172,9 @@ public function loadByProperties(array $conditions = array()) { * {@inheritdoc} */ protected function mapFromStorageRecords(array $records) { - foreach ($records as $key => $record) { + foreach ($records as &$record) { $class = $this->fieldTypeManager->getPluginClass($record['type']); $record['settings'] = $class::settingsFromConfigData($record['settings']); - $records[$key] = $record; } return parent::mapFromStorageRecords($records); } diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php index 471c462..ede945e 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -258,7 +258,7 @@ public static function settingsFromConfigData(array $settings) { } /** - * Simplify allowed values to a key-value array from the structured array. + * Simplifies allowed values to a key-value array from the structured array. * * @param array $structured_values * Array of items with a 'value' and 'label' key each for the allowed