diff --git a/core/lib/Drupal/Core/ConfigThingie/ConfigThingieBase.php b/core/lib/Drupal/Core/Configurable/ConfigurableBase.php similarity index 69% rename from core/lib/Drupal/Core/ConfigThingie/ConfigThingieBase.php rename to core/lib/Drupal/Core/Configurable/ConfigurableBase.php index 3f83cf4..4f22661 100644 --- a/core/lib/Drupal/Core/ConfigThingie/ConfigThingieBase.php +++ b/core/lib/Drupal/Core/Configurable/ConfigurableBase.php @@ -2,17 +2,17 @@ /** * @file - * Definition of Drupal\Core\ConfigThingie\ConfigThingieBase. + * Definition of Drupal\Core\Configurable\ConfigurableBase. */ -namespace Drupal\Core\ConfigThingie; +namespace Drupal\Core\Configurable; use Drupal\Core\Config\Config; /** - * Defines the base configuration thingie. + * Defines the base configurable object. */ -abstract class ConfigThingieBase implements ConfigThingieInterface { +abstract class ConfigurableBase implements ConfigurableInterface { /** * The configuration object. * @@ -21,21 +21,21 @@ abstract class ConfigThingieBase implements ConfigThingieInterface { protected $config; /** - * The key of the thingie's ID (machine name). + * The key of the configurable object's ID (machine name). * * @var string */ public $idKey = 'id'; /** - * The key of the thingie's label. + * The key of the configurable object's label. * * @var string */ public $labelKey = 'label'; /** - * The thingie's original ID, if any. + * The configurable object's original ID, if any. * * @var string|null */ @@ -44,33 +44,33 @@ abstract class ConfigThingieBase implements ConfigThingieInterface { /** * The original configuration object, if any, upon update. * - * @var Drupal\Core\ConfigThingie\ConfigThingieInterface + * @var Drupal\Core\Configurable\ConfigurableInterface */ public $original; /** - * Constructs a new configuration thingie. + * Constructs a new configurable object. */ public function __construct(Config $config) { $this->setConfig($config); } /** - * Returns the configuration thingie object's name prefix. + * Returns the configurable object's name prefix. * * @return string * The configuration object name prefix; e.g., for a 'node.type.article' - * thingie, this returns 'node.type'. + * configurable object, this returns 'node.type'. */ abstract public function getConfigPrefix(); /** - * Returns the fully qualified configuration object name for this configuration thingie. + * Returns the fully qualified configuration object name for this configurable object. * * @return string - * The configuration object name for this configuration thingie. Normally, - * ConfigThingieInterface::getConfigPrefix() and - * ConfigThingieInterface::getID() form the full configuration object name; + * The configuration object name for this configurable object. Normally, + * ConfigurableInterface::getConfigPrefix() and + * ConfigurableInterface::getID() form the full configuration object name; * i.e., '[prefix].[id]'. */ public function getConfigName() { @@ -78,61 +78,61 @@ abstract class ConfigThingieBase implements ConfigThingieInterface { } /** - * Returns the basename used for events/hooks for this configuration thingie. + * Returns the basename used for events/hooks for this configurable object. * * @return string - * The basename for events/hooks; e.g., for a 'node.type.article' thingie, - * this returns 'node_type'. Normally, this is auto-generated based on - * ConfigThingieInterface::getConfigPrefix(). + * The basename for events/hooks; e.g., for a 'node.type.article' + * configurable object, this returns 'node_type'. Normally, this is + * auto-generated based on ConfigurableInterface::getConfigPrefix(). */ public function getEventBasename() { return str_replace('.', '_', $this->getConfigPrefix()); } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::getID(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::getID(). */ public function getID() { return $this->config->get($this->idKey); } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::isNew(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::isNew(). */ public function isNew() { return $this->config->isNew(); } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::getLabel(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::getLabel(). */ public function getLabel() { return $this->config->get($this->labelKey); } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::get(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::get(). */ public function get($property_name) { return $this->config->get($property_name); } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::set(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::set(). */ public function set($property_name, $value) { return $this->config->set($property_name, $value); } /** - * Sets the configuration object for this configuration thingie. + * Sets the configuration object for this configurable object. * * @param Drupal\Core\Config\Config $config - * The configuration object containing the data for this configuration - * thingie. + * The configuration object containing the data for this configurable + * object. * - * @return Drupal\Core\ConfigThingie\ConfigThingieInterface - * This configuration thingie (suitable for chained method calls). + * @return Drupal\Core\Configurable\ConfigurableInterface + * This configurable object (suitable for chained method calls). */ public function setConfig(Config $config) { $this->config = $config; @@ -149,14 +149,14 @@ abstract class ConfigThingieBase implements ConfigThingieInterface { } /** - * Sets the unchanged original of this configuration thingie. + * Sets the unchanged original of this configurable object. * * @param Drupal\Core\Config\Config $config * The configuration object containing the original data for this - * configuration thingie. + * configurable object. * - * @return Drupal\Core\ConfigThingie\ConfigThingieInterface - * This configuration thingie (suitable for chained method calls). + * @return Drupal\Core\Configurable\ConfigurableInterface + * This configurable object (suitable for chained method calls). */ public function setOriginal(Config $config) { $this->original = new $this($config); @@ -168,15 +168,15 @@ abstract class ConfigThingieBase implements ConfigThingieInterface { } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::save(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::save(). */ public function save() { - // Provide the original configuration thingie in $this->original, if any. - // originalID is only set, if this configuration thingie already existed + // Provide the original configurable object in $this->original, if any. + // originalID is only set, if this configurable object already existed // prior to saving. if (isset($this->originalID)) { // Load the original configuration object. - // This cannot use ConfigThingieBase::getConfigName(), since that would + // This cannot use ConfigurableBase::getConfigName(), since that would // yield the name using the current/new ID. $original_config = config($this->getConfigPrefix() . '.' . $this->originalID); // Given the original configuration object, instantiate a new class of the @@ -217,7 +217,7 @@ abstract class ConfigThingieBase implements ConfigThingieInterface { } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::delete(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::delete(). */ public function delete() { // Allow modules to react prior to deleting the configuration. diff --git a/core/lib/Drupal/Core/ConfigThingie/ConfigThingieInterface.php b/core/lib/Drupal/Core/Configurable/ConfigurableInterface.php similarity index 45% rename from core/lib/Drupal/Core/ConfigThingie/ConfigThingieInterface.php rename to core/lib/Drupal/Core/Configurable/ConfigurableInterface.php index 506ffa2..921df12 100644 --- a/core/lib/Drupal/Core/ConfigThingie/ConfigThingieInterface.php +++ b/core/lib/Drupal/Core/Configurable/ConfigurableInterface.php @@ -2,57 +2,57 @@ /** * @file - * Definition of Drupal\Core\ConfigThingie\ConfigThingieInterface. + * Definition of Drupal\Core\Configurable\ConfigurableInterface. */ -namespace Drupal\Core\ConfigThingie; +namespace Drupal\Core\Configurable; /** - * Defines the interface common for all configuration thingies. + * Defines the interface common for all configurable objects. */ -interface ConfigThingieInterface { +interface ConfigurableInterface { /** - * Returns the ID (machine name) of this configuration thingie. + * Returns the ID (machine name) of this configurable object. * * @return string - * The ID (machine name) of this configuration thingie. Normally, this is + * The ID (machine name) of this configurable object. Normally, this is * the part of the configuration object name after - * ConfigThingieInterface::getConfigPrefix(), and also a property within the + * ConfigurableInterface::getConfigPrefix(), and also a property within the * configuration object. */ public function getID(); /** - * Returns whether this configuration thingie is new or have been saved already. + * Returns whether this configurable object is new or have been saved already. * * @return bool - * Whether this configuration thingie is new (TRUE) or has been saved + * Whether this configurable object is new (TRUE) or has been saved * already (FALSE). */ public function isNew(); /** - * Returns the human-readable label of this configuration thingie. + * Returns the human-readable label of this configurable object. * * @return string - * The label of this configuration thingie. + * The label of this configurable object. */ public function getLabel(); /** - * Returns the router path to the administrative page for this configuration thingie. + * Returns the router path to the administrative page for this configurable object. * * @return string - * The router path of this configuration thingie. + * The router path of this configurable object. * * @todo Check whether this makes sense. Requires access handling and stuff, - * which should probably be harmonized for all configuration thingies, too, + * which should probably be harmonized for all configurable objects, too, * but... later. */ public function getURI(); /** - * Returns the value of a given property from this configuration thingie. + * Returns the value of a given property from this configurable object. * * @param string $property_name * The name of the property to look up. @@ -64,28 +64,28 @@ interface ConfigThingieInterface { public function get($property_name); /** - * Sets the value of a given property for this configuration thingie. + * Sets the value of a given property for this configurable object. * * @param string $property_name * The name of the property to set. * @param mixed $value * The value to set. * - * @return Drupal\Core\ConfigThingie\ConfigThingieInterface - * This configuration thingie (suitable for chained method calls). + * @return Drupal\Core\Configurable\ConfigurableInterface + * This configurable object (suitable for chained method calls). */ public function set($property_name, $value); /** - * Saves this configuration thingie. + * Saves this configurable object. * - * @return Drupal\Core\ConfigThingie\ConfigThingieInterface - * This configuration thingie (suitable for chained method calls). + * @return Drupal\Core\Configurable\ConfigurableInterface + * This configurable object (suitable for chained method calls). */ public function save(); /** - * Deletes this configuration thingie. + * Deletes this configurable object. */ public function delete(); } diff --git a/core/modules/config/config.api.php b/core/modules/config/config.api.php index f0c3afa..99cdcd6 100644 --- a/core/modules/config/config.api.php +++ b/core/modules/config/config.api.php @@ -31,7 +31,7 @@ * A configuration object containing the old configuration data. */ function MODULE_config_import_create($name, $new_config, $old_config) { - // Only configurable thingies require custom handling. Any other module + // Only configurable objects require custom handling. Any other module // settings can be synchronized directly. if (strpos($name, 'config_test.dynamic.') !== 0) { return FALSE; @@ -60,7 +60,7 @@ function MODULE_config_import_create($name, $new_config, $old_config) { * A configuration object containing the old configuration data. */ function MODULE_config_import_change($name, $new_config, $old_config) { - // Only configurable thingies require custom handling. Any other module + // Only configurable objects require custom handling. Any other module // settings can be synchronized directly. if (strpos($name, 'config_test.dynamic.') !== 0) { return FALSE; @@ -90,7 +90,7 @@ function MODULE_config_import_change($name, $new_config, $old_config) { * A configuration object containing the old configuration data. */ function MODULE_config_import_delete($name, $new_config, $old_config) { - // Only configurable thingies require custom handling. Any other module + // Only configurable objects require custom handling. Any other module // settings can be synchronized directly. if (strpos($name, 'config_test.dynamic.') !== 0) { return FALSE; diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigConfigurableTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigConfigurableTest.php index cfb4bcc..d993ae4 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigConfigurableTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigConfigurableTest.php @@ -29,7 +29,7 @@ class ConfigConfigurableTest extends WebTestBase { * Tests basic CRUD operations through the UI. */ function testCRUD() { - // Create a thingie. + // Create a configurable object. $id = 'thingie'; $edit = array( 'id' => $id, @@ -39,7 +39,7 @@ class ConfigConfigurableTest extends WebTestBase { $this->assertResponse(200); $this->assertText('Thingie'); - // Update the thingie. + // Update the configurable object. $this->assertLinkByHref('admin/structure/config_test/manage/' . $id); $edit = array( 'label' => 'Thongie', @@ -49,14 +49,14 @@ class ConfigConfigurableTest extends WebTestBase { $this->assertNoText('Thingie'); $this->assertText('Thongie'); - // Delete the thingie. + // Delete the configurable object. $this->assertLinkByHref('admin/structure/config_test/manage/' . $id . '/delete'); $this->drupalPost('admin/structure/config_test/manage/' . $id . '/delete', array(), 'Delete'); $this->assertResponse(200); $this->assertNoText('Thingie'); $this->assertNoText('Thongie'); - // Re-create a thingie. + // Re-create a configurable object. $edit = array( 'id' => $id, 'label' => 'Thingie', @@ -65,7 +65,7 @@ class ConfigConfigurableTest extends WebTestBase { $this->assertResponse(200); $this->assertText('Thingie'); - // Rename the thingie's ID/machine name. + // Rename the configurable object's ID/machine name. $this->assertLinkByHref('admin/structure/config_test/manage/' . $id); $new_id = 'zingie'; $edit = array( diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php index a9676ef..26dacea 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php @@ -26,12 +26,12 @@ class ConfigInstallTest extends WebTestBase { */ function testModuleInstallation() { $default_config = 'config_test.system'; - $default_thingie = 'config_test.dynamic.default'; + $default_configurable = 'config_test.dynamic.default'; // Verify that default module config does not exist before installation yet. $config = config($default_config); $this->assertIdentical($config->isNew(), TRUE); - $config = config($default_thingie); + $config = config($default_configurable); $this->assertIdentical($config->isNew(), TRUE); // Install the test module. @@ -40,15 +40,15 @@ class ConfigInstallTest extends WebTestBase { // Verify that default module config exists. $config = config($default_config); $this->assertIdentical($config->isNew(), FALSE); - $config = config($default_thingie); + $config = config($default_configurable); $this->assertIdentical($config->isNew(), FALSE); // Verify that configuration import callback was invoked for the dynamic - // thingie. + // configurable object. $this->assertTrue($GLOBALS['hook_config_import']); // Verify that config_test API hooks were invoked for the dynamic default - // thingie. + // configurable object. $this->assertTrue(isset($GLOBALS['hook_config_test_dynamic']['load'])); $this->assertTrue(isset($GLOBALS['hook_config_test_dynamic']['presave'])); $this->assertTrue(isset($GLOBALS['hook_config_test_dynamic']['insert'])); diff --git a/core/modules/config/tests/config_test/config_test.hooks.inc b/core/modules/config/tests/config_test/config_test.hooks.inc index 2ec6831..e794d7e 100644 --- a/core/modules/config/tests/config_test/config_test.hooks.inc +++ b/core/modules/config/tests/config_test/config_test.hooks.inc @@ -2,11 +2,11 @@ /** * @file - * Fake third-party hook implementations for ConfigTest/config_test thingies. + * Fake third-party hook implementations for ConfigTest/config_test configurable objects. * * Testing the module/hook system is not the purpose of this test helper module. * Therefore, this file implements hooks on behalf of config_test module for - * config_test thingie hooks themselves. + * config_test configurable objects hooks themselves. */ /** diff --git a/core/modules/config/tests/config_test/config_test.module b/core/modules/config/tests/config_test/config_test.module index fe18c4a..b1d1cba 100644 --- a/core/modules/config/tests/config_test/config_test.module +++ b/core/modules/config/tests/config_test/config_test.module @@ -8,7 +8,7 @@ require_once dirname(__FILE__) . '/config_test.hooks.inc'; * Implements MODULE_config_import_create(). */ function config_test_config_import_create($name, $new_config, $old_config) { - // Only configurable thingies require custom handling. Any other module + // Only configurable objects require custom handling. Any other module // settings can be synchronized directly. if (strpos($name, 'config_test.dynamic.') !== 0) { return FALSE; @@ -25,7 +25,7 @@ function config_test_config_import_create($name, $new_config, $old_config) { * Implements MODULE_config_import_change(). */ function config_test_config_import_change($name, $new_config, $old_config) { - // Only configurable thingies require custom handling. Any other module + // Only configurable objects require custom handling. Any other module // settings can be synchronized directly. if (strpos($name, 'config_test.dynamic.') !== 0) { return FALSE; @@ -43,7 +43,7 @@ function config_test_config_import_change($name, $new_config, $old_config) { * Implements MODULE_config_import_delete(). */ function config_test_config_import_delete($name, $new_config, $old_config) { - // Only configurable thingies require custom handling. Any other module + // Only configurable objects require custom handling. Any other module // settings can be synchronized directly. if (strpos($name, 'config_test.dynamic.') !== 0) { return FALSE; diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTest.php index 4efaae5..748e81f 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTest.php @@ -7,12 +7,12 @@ namespace Drupal\config_test; -use Drupal\Core\ConfigThingie\ConfigThingieBase; +use Drupal\Core\Configurable\ConfigurableBase; /** - * Defines the ConfigTest configuration thingie. + * Defines the ConfigTest configurable object. */ -class ConfigTest extends ConfigThingieBase { +class ConfigTest extends ConfigurableBase { /** * The image style to use. * @@ -21,14 +21,14 @@ class ConfigTest extends ConfigThingieBase { public $style; /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::getConfigPrefix(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::getConfigPrefix(). */ public function getConfigPrefix() { return 'config_test.dynamic'; } /** - * Implements Drupal\Core\ConfigThingie\ConfigThingieInterface::getURI(). + * Implements Drupal\Core\Configurable\ConfigurableInterface::getURI(). */ public function getURI() { return 'admin/structure/config_test/manage/' . $this->getID();