diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php index e10cc91..8861481 100644 --- a/core/lib/Drupal/Core/Config/Config.php +++ b/core/lib/Drupal/Core/Config/Config.php @@ -203,13 +203,13 @@ public function clear($key) { /** * {@inheritdoc} */ - public function save($trusted_data = FALSE) { + public function save($has_trusted_data = FALSE) { // Validate the configuration object name before saving. static::validateName($this->name); // If there is a schema for this configuration object, cast all values to // conform to the schema. - if (!$trusted_data) { + if (!$has_trusted_data) { if ($this->typedConfigManager->hasConfigSchema($this->name)) { // Ensure that the schema wrapper has the latest data. $this->schemaWrapper = NULL; diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index 7b10e0b..eae4c59 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -233,7 +233,7 @@ protected function createConfiguration($collection, array $config_to_install) { $entity = $entity_storage->createFromStorageRecord($new_config->get()); } if ($entity->isInstallable()) { - $entity->setTrustedData()->save(); + $entity->trustData()->save(); } } else { diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 6f692dd..676fc4d 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -564,7 +564,7 @@ public function isInstallable() { /** * {@inheritdoc} */ - public function setTrustedData() { + public function trustData() { $this->trustedData = TRUE; return $this; } @@ -572,7 +572,7 @@ public function setTrustedData() { /** * {@inheritdoc} */ - public function getTrustedData() { + public function hasTrustedData() { return $this->trustedData; } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php index 6df6127..3018559 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php @@ -214,7 +214,7 @@ public function isInstallable(); * * @return $this */ - public function setTrustedData(); + public function trustData(); /** * Gets whether on not the data is trusted. @@ -222,6 +222,6 @@ public function setTrustedData(); * @return bool * TRUE if the configuration data is trusted, FALSE if not. */ - public function getTrustedData(); + public function hasTrustedData(); } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index ff0df4c..6c314b5 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -256,7 +256,7 @@ protected function doSave($id, EntityInterface $entity) { // Retrieve the desired properties and set them in config. $config->setData($this->mapToStorageRecord($entity)); - $config->save($entity->getTrustedData()); + $config->save($entity->hasTrustedData()); return $is_new ? SAVED_NEW : SAVED_UPDATED; } diff --git a/core/lib/Drupal/Core/Config/ImmutableConfig.php b/core/lib/Drupal/Core/Config/ImmutableConfig.php index af7d140..d4bdaf5 100644 --- a/core/lib/Drupal/Core/Config/ImmutableConfig.php +++ b/core/lib/Drupal/Core/Config/ImmutableConfig.php @@ -44,7 +44,7 @@ public function clear($key) { /** * {@inheritdoc} */ - public function save($trusted_data = FALSE) { + public function save($has_trusted_data = FALSE) { throw new ImmutableConfigException(String::format('Can not save immutable configuration !name. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object', ['!name' => $this->getName()])); } diff --git a/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php index 101f5b6..9f08a8f 100644 --- a/core/lib/Drupal/Core/Config/StorableConfigBase.php +++ b/core/lib/Drupal/Core/Config/StorableConfigBase.php @@ -66,16 +66,16 @@ /** * Saves the configuration object. * - * @param bool $trusted_data - * Set to TRUE is the configuration has already been checked that it - * conforms to schema. Generally this is only used during module and theme - * installation. + * @param bool $has_trusted_data + * Set to TRUE is the configuration data has already been checked to ensure + * it conforms to schema. Generally this is only used during module and + * theme installation. * * Must invalidate the cache tags associated with the configuration object. * * @return $this */ - abstract public function save($trusted_data = FALSE); + abstract public function save($has_trusted_data = FALSE); /** * Deletes the configuration object. @@ -224,17 +224,4 @@ protected function castValue($key, $value) { return $value; } - /** - * Indicates that the configuration data is trusted. - * - * If the configuration data is trusted then we don't need to check schema on - * save. - * - * @return $this - */ - public function setTrustedData() { - $this->trustedData = TRUE; - return $this; - } - } diff --git a/core/modules/language/src/Config/LanguageConfigOverride.php b/core/modules/language/src/Config/LanguageConfigOverride.php index c66f3b9..b673f34 100644 --- a/core/modules/language/src/Config/LanguageConfigOverride.php +++ b/core/modules/language/src/Config/LanguageConfigOverride.php @@ -50,8 +50,8 @@ public function __construct($name, StorageInterface $storage, TypedConfigManager /** * {@inheritdoc} */ - public function save($trusted_data = FALSE) { - if (!$trusted_data) { + public function save($has_trusted_data = FALSE) { + if (!$has_trusted_data) { // @todo Use configuration schema to validate. // https://drupal.org/node/2270399 // Perform basic data validation. diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php index cb1d321..edad16b 100644 --- a/core/modules/views_ui/src/ViewUI.php +++ b/core/modules/views_ui/src/ViewUI.php @@ -1256,15 +1256,15 @@ public function isInstallable() { /** * {@inheritdoc} */ - public function setTrustedData() { - return $this->storage->setTrustedData(); + public function trustData() { + return $this->storage->trustData(); } /** * {@inheritdoc} */ - public function getTrustedData() { - return $this->storage->getTrustedData(); + public function hasTrustedData() { + return $this->storage->hasTrustedData(); } }