diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index a5f51fc..f82af84 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -12,17 +12,18 @@ use Drupal\Component\Utility\String; /** - * Provides an implementation of a config entity type and its metadata. + * Provides an implementation of a configuration entity type and its metadata. */ class ConfigEntityType extends EntityType { /** - * Length limit of the config prefix returned by getConfigPrefix(). + * Length limit of the configuration entity prefix. * - * We set the limit to 83 characters because that leaves 166 characters for - * the configuration entity ID and that totals to 250 characters which is the - * maximum recommended file name for most file systems, leaving 5 characters - * for the file extension. This limit if for the module.prefix combo. + * Most file systems limit a file name's length to 255 characters. In + * order to leave sufficient characters to construct a configuration ID, + * the configuration entity prefix is limited to 83 characters which + * leaves 166 characters for the configuration ID. 5 characters are + * reserved for the file extension. * * @see \Drupal\Core\Config\ConfigBase::MAX_NAME_LENGTH */ @@ -48,11 +49,11 @@ public function getControllerClasses() { * {@inheritdoc} */ public function getConfigPrefix() { - // Ensure that all configuration entities are prefixed by the module that - // provides the configuration entity type. This ensures that default - // configuration will be created as expected during module install and - // dependencies can be calculated without the modules that provide the - // entity types being installed. + // Ensure that all configuration entities are prefixed by the name of the + // module that provides the configuration entity type. This ensures that + // default configuration will be created as expected during module + // installation and dependencies can be calculated without the modules that + // provide the entity types being installed. if (isset($this->config_prefix)) { $config_prefix = $this->provider . '.' . $this->config_prefix; } diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php index 94b9348..6befb00 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php @@ -44,6 +44,12 @@ public function testConfigPrefixLengthExceeds($entity_data, $exception, $message $this->assertEmpty($config_entity->getConfigPrefix()); } + /** + * Provides arguments to instantiate a ConfigEntityType with a configuration + * entity prefix that exceeds the maximum character length. + * + * @return array + */ public function providerPrefixLengthExceeds() { $test_parameters = array(); $message_text = 'The configuration file name prefix @config_prefix exceeds the maximum character limit of @max_char.'; @@ -98,6 +104,12 @@ public function testConfigPrefixLengthValid($entity_data) { $this->assertEquals($expected_prefix, $config_entity->getConfigPrefix()); } + /** + * Provides arguments to instantiate a ConfigEntityType with a configuration + * entity prefix that does not exceed the maximum character length. + * + * @return array + */ public function providerPrefixLengthValid() { $test_parameters = array();