diff -u b/core/includes/config.inc b/core/includes/config.inc --- b/core/includes/config.inc +++ b/core/includes/config.inc @@ -173,14 +173,13 @@ /** * Retrieves metadata for a configuration object or key. * - * The metadata contains a multidimensional arrays where the keys are the - * same keys found in a config object and the values are $definition arrays to - * be passed to - * \Drupal\Core\TypedData\TypedDataManager::create(). In order to avoid - * confusion between what is a config name and what is a type data definition, - * the typed data definition is prefixed by a dot. + * The metadata has the same structure as the configuration object itself but + * the configuration values are replaced by an array containing exactly one + * element. The key is .meta and the value is a $definition array to + * be passed to typed_data()->create() or + * \Drupal\Core\TypedData\TypedDataManager::create(). * - * For example, for the config file core/modules/system/meta/system.site.yml: + * For example, for the config file core/modules/system/config/system.site.yml: * @code * name: Site-Install * mail: admin@example.com @@ -190,43 +189,28 @@ * 404: 'pages/404' * @endcode * - * The metadata will be: + * The metadata in core/modules/system/meta/system.site.yml: * @code * name: - * .label: 'Site name' - * .type: 'text' + * .meta: + * label: 'Site name' + * type: text * mail: - * .label: 'Site mail' + * .meta: + * label: 'Site mail' * slogan: - * .label: 'Site slogan' - * .type: 'text' + * .meta: + * label: 'Site slogan' + * type: text * page: - * .list: '1' + * .meta: + * label: 'Default pages' * 403: - * .label: 'Default 403 (access denied) page' - * .type: 'string' + * .meta: + * label: 'Default 403 (access denied) page' * 404: - * .label: 'Default 404 (not found) page' - * .type: 'string' - * @endcode - * - * In this example, we only defined label and type metadata, everything else - * are the same keys as in the config file itself. For a given entry in the - * configuration data we have a corresponding one in the metadata, easy to - * find because the same keys lead there. For site name (configuration key - * 'site'), this is the metadata: - * - * @code - * .label: 'Site name' - * .type: 'text' - * @endcode - * - * That would be translated in the following element definition: - * @code - * array( - * 'label' => 'Site name', - * 'type' => 'label' - * ); + * .meta: + * label: 'Default 404 (not found) page' * @endcode * * Elements that don't have an explicit type will default to the type 'string' @@ -249,21 +233,26 @@ * * The metadata is in core/modules/user/meta/user.mail.yml: * @code - * .label: 'User mails' - * .list: '1' - * .list settings: - * elements name: 'user.mail.%' + * .meta: + * label: 'User mails' + * list: '1' + * list settings: + * elements name: 'user.mail.%' * @endcode * - * For every element, meta/user.mail.%.yml is read: + * For every element, meta/user.mail.%.yml is read as specified by the + * 'elements name' list settings: * @end - * .label: 'Mail text' + * .meta: + * label: 'Mail text' * subject: - * .label: 'Subject' - * .type: 'text' + * .meta: + * label: 'Subject' + * type: 'text' * body: - * .label: 'Body' - * .type: 'text' + * .meta: + * label: 'Body' + * type: 'text' * @endcode * * As said above, the type for list elements is config_element, so the @@ -299,17 +288,20 @@ * The metadata is in core/modules/image/meta/image.style.%.yml: * @code * name: - * .label: 'Machine name' - * .type: string + * .meta: + * label: 'Machine name' + * type: string * label: - * .label: 'Label' - * .type: text + * .meta: + * label: 'Label' + * type: text * effects: - * .label: 'Style effects' - * .list: '1' - * .list settings: - * elements name: 'image.style.effects.%' - * elements key: 'name' + * .meta: + * label: 'Style effects' + * list: '1' + * list settings: + * elements name: 'image.style.effects.%' + * elements key: 'name' * @endcode * * In this case we want to reuse the metadata for 'image_scale' every time @@ -319,21 +311,25 @@ * meta/image.style.effects.image_scale.yml is used if it exists and * meta/image.style.effects.%.yml if it does not. * - * Here are some parts of meta/image.style.effects.image_scale.yml: + * For example here are some parts of + * meta/image.style.effects.image_scale.yml: * @code - * name: - * .label: 'Style name' - * .type: string - * data: - * .label: 'Image scale' - * width: - * .label: 'Width' - * .type: 'integer' - * weight: - * .label: 'Weight' - * .type: integer - * ieid: - * .label: 'IEID' + * .meta: + * label: 'Image scale' + * name: + * .meta: + * label: 'Machine name' + * type: string + * ieid: + * .meta: + * label: 'IEID' + * data: + * .meta: + * label: 'Data' + * width: + * .meta: + * label: 'Width' + * type: 'integer' * @endcode * * @see Drupal\Core\TypedData\TypedDataManager::create() @@ -350,11 +346,7 @@ * @see Drupal\Core\Config\Metadata\ElementInterface::getMetadata() */ function config_metadata($name) { - $metadata = &drupal_static(__FUNCTION__); - if (!$metadata) { - $metadata = new MetadataLookup(); - } - return $metadata[$name]; + return drupal_container()->get('config.metadata')->offsetGet($name); } /** @@ -367,7 +359,7 @@ * A configuration wrapper object. */ function config_wrapper($name) { - return new TypedConfig($name, config($name)->get()); + return drupal_container()->get('config.typed')->get($name); } /** diff -u b/core/lib/Drupal/Core/Config/Metadata/ElementBase.php b/core/lib/Drupal/Core/Config/Metadata/ElementBase.php --- b/core/lib/Drupal/Core/Config/Metadata/ElementBase.php +++ b/core/lib/Drupal/Core/Config/Metadata/ElementBase.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Config\Metadata; -use Drupal\Core\Language\Language; use Drupal\Core\TypedData\TypedDataInterface; use Drupal\Core\TypedData\Type\TypedData; use ArrayIterator; @@ -45,7 +44,7 @@ /** * Parent configuration wrapper. * - * @var Drupal\Core\Config\ElementInterface + * @var \Drupal\Core\Config\Metadata\ElementInterface */ protected $parent; @@ -97,8 +96,7 @@ * Configuration metadata for the element. */ protected function buildElementMetadata($key, $data) { - $metadata = $this->getMetadata(); - return isset($metadata[$key]) ? $metadata[$key] : array(); + return isset($this->metadata[$key]) ? $this->metadata[$key] : array(); } /** @@ -244,10 +242,10 @@ * Metadata for the element. * @param string $key * Nested configuration key to be used as element's name. - * @param Drupal\Core\Config\Metadata\ElementInterface $parent + * @param \Drupal\Core\Config\Metadata\ElementInterface $parent * (optional) Element to be used as parent of this one. Defaults to NULL. * - * @return Drupal\Core\TypedData\TypedDataInterface + * @return \Drupal\Core\TypedData\TypedDataInterface * A TypedDataInterface object containing the configuration value. */ public static function buildElement($value, $metadata, $key, $parent = NULL) { @@ -278,27 +276,18 @@ * The elemement's data definition. */ public static function buildDefinition($data, $metadata) { - $element = $children = array(); - foreach ($metadata as $name => $value) { - if (strpos($name, '.') === 0) { - // Metadata properties will be prefixed by a dot. - $element[substr($name, 1)] = $value; - } - else { - // Children elements will be arrays of metadata themselves. - $children[$name] = $value; - } - } + $definition = isset($metadata['.meta']) ? $metadata['.meta'] : array(); + unset($metadata['.meta']); // The default type will depend on whether we've got children or not. - if (!isset($element['type'])) { - if (!empty($children) || is_array($data) || !empty($element['list']) || !empty($element['list settings'])) { - $element['type'] = 'config_element'; + if (!isset($definition['type'])) { + if (!empty($metadata) || is_array($data) || !empty($definition['list']) || !empty($definition['list settings'])) { + $definition['type'] = 'config_element'; } else { - $element['type'] = 'string'; + $definition['type'] = 'string'; } } - return $element; + return $definition; } } diff -u b/core/lib/Drupal/Core/Config/Metadata/MetadataLookup.php b/core/lib/Drupal/Core/Config/Metadata/MetadataLookup.php --- b/core/lib/Drupal/Core/Config/Metadata/MetadataLookup.php +++ b/core/lib/Drupal/Core/Config/Metadata/MetadataLookup.php @@ -37,14 +37,15 @@ /** * Storage to retrieve the metadata. * - * @var Drupal\Core\Config\Metadata\MetadataStorage + * @var \Drupal\Core\Config\Metadata\MetadataStorage */ protected $metadataStorage; /** * Constructs a ConfigMetadata cache object. */ - public function __construct() { + public function __construct(MetadataStorage $metadata_storage) { + $this->metadataStorage = $metadata_storage; parent::__construct('config:metadata', 'cache'); } @@ -52,9 +53,9 @@ * Overrides DrupalCacheArray::resolveCacheMiss(). */ protected function resolveCacheMiss($offset) { - $metadata = $this->readMetadata($offset); + $metadata = $this->metadataStorage->read($offset); // If no metadata with this exact name, try the fallback name. - if (!$metadata && $basename = $this->getFallbackName($offset)) { + if ($metadata === FALSE && ($basename = $this->getFallbackName($offset))) { $metadata = $this->offsetGet($basename); } $this->storage[$offset] = $metadata ? $metadata : array(); @@ -73,29 +74,8 @@ protected static function getFallbackName($name) { - $parts = explode('.', $name); - $last = array_pop($parts); - // If this is not the generic metadata (where the last component of the - // name is a '%'), try to load that first. - if ($last != self::BASE_MARK) { - return implode('.', array_merge($parts, array(self::BASE_MARK))); + $replaced = preg_replace('/\.[^.]+$/', '.' . self::BASE_MARK, $name); + if ($replaced != $name) { + return $replaced; } } - /** - * Reads metadata from file system. - * - * @param string $name - * Configuration name or key. - * - * @return array - * Metadata array if found or empty array if not. - * - * @throws Symfony\Component\Yaml\Exception\ParseException - */ - protected function readMetadata($name) { - if (!isset($this->metadataStorage)) { - $this->metadataStorage = new MetadataStorage(); - } - return $this->metadataStorage->read($name); - } - } diff -u b/core/lib/Drupal/Core/Config/Metadata/TypedConfig.php b/core/lib/Drupal/Core/Config/Metadata/TypedConfig.php --- b/core/lib/Drupal/Core/Config/Metadata/TypedConfig.php +++ b/core/lib/Drupal/Core/Config/Metadata/TypedConfig.php @@ -23,7 +23,7 @@ /** * The base typed data element for this configuration data. * - * @var Drupal\Core\TypedData\TypedDataInterface + * @var \Drupal\Core\TypedData\TypedDataInterface */ protected $base; @@ -65,7 +65,7 @@ * Unlike the get() method of the base configuration object, this one returns * a typed data object instead of raw configuration data. * - * @return Drupal\Core\TypedData\TypedDataInterface + * @return \Drupal\Core\TypedData\TypedDataInterface * The data that was requested. */ public function get($key = '') { @@ -110,7 +110,7 @@ /** * Gets the configuration language. * - * @return Drupal\Core\Language\Language + * @return \Drupal\Core\Language\Language * The language object. */ public function getLanguage() { diff -u b/core/modules/config/lib/Drupal/config/Tests/ConfigMetadataTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigMetadataTest.php --- b/core/modules/config/lib/Drupal/config/Tests/ConfigMetadataTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigMetadataTest.php @@ -35,39 +35,36 @@ function testBasicMetadata() { // Simple case, straight metadata. $metadata = config_metadata('system.maintenance'); - $expected = array( - 'enabled' => array( - '.label' => 'Put site into maintenance mode', - '.type' => 'boolean' - ), - 'message' => array( - '.label' => 'Message to display when in maintenance mode', - '.type' => 'text', - ), + $expected = array(); + $expected['enabled']['.meta'] = array( + 'label' => 'Put site into maintenance mode', + 'type' => 'boolean' + ); + $expected['message']['.meta'] = array( + 'label' => 'Message to display when in maintenance mode', + 'type' => 'text', ); $this->assertEqual($metadata, $expected, 'Retrieved the right metadata for system.maintenance'); // More complex case, fallback to parent name. $metadata = config_metadata('image.style.large'); - $expected = array( - 'name' => array( - '.label' => 'Machine name', - '.type' => 'string', - ), - 'label' => array( - '.label' => 'Label', - '.type' => 'text' + $expected = array(); + $expected['name']['.meta'] = array( + 'label' => 'Machine name', + 'type' => 'string', + ); + $expected['label']['.meta'] = array( + 'label' => 'Label', + 'type' => 'text' + ); + $expected['effects']['.meta'] = array( + 'label' => 'Style effects', + 'list' => '1', + 'list settings' => array( + 'elements name' => 'image.style.effects.%', + 'elements key' => 'name' ), - 'effects' => array( - '.label' => 'Style effects', - '.list' => '1', - '.list settings' => array( - 'elements name' => 'image.style.effects.%', - 'elements key' => 'name' - ), - ) ); $this->assertEqual($metadata, $expected, 'Retrieved the right metadata for image.style.large'); - } /** diff -u b/core/modules/contact/meta/contact.category.%.yml b/core/modules/contact/meta/contact.category.%.yml --- b/core/modules/contact/meta/contact.category.%.yml +++ b/core/modules/contact/meta/contact.category.%.yml @@ -1,17 +1,23 @@ -.settings: - label: label +.meta: + settings: + label: label id: - .type: string - .label: 'Id' + .meta: + type: string + label: 'Id' label: - .type: text - .label: 'Label' + .meta: + type: text + label: 'Label' recipients: - .list: '1' - .label: 'Recipients' + .meta: + list: '1' + label: 'Recipients' reply: - .type: text - .label: 'Reply' + .meta: + type: text + label: 'Reply' weight: - .type: integer - .label: 'Weight' + .meta: + type: integer + label: 'Weight' diff -u b/core/modules/image/meta/image.style.%.yml b/core/modules/image/meta/image.style.%.yml --- b/core/modules/image/meta/image.style.%.yml +++ b/core/modules/image/meta/image.style.%.yml @@ -2,11 +2,14 @@ - .label: 'Machine name' - .type: string + .meta: + label: 'Machine name' + type: string label: - .label: 'Label' - .type: text + .meta: + label: 'Label' + type: text effects: - .label: 'Style effects' - .list: '1' - .list settings: - elements name: 'image.style.effects.%' - elements key: 'name' + .meta: + label: 'Style effects' + list: '1' + list settings: + elements name: 'image.style.effects.%' + elements key: 'name' diff -u b/core/modules/image/meta/image.style.effects.%.yml b/core/modules/image/meta/image.style.effects.%.yml --- b/core/modules/image/meta/image.style.effects.%.yml +++ b/core/modules/image/meta/image.style.effects.%.yml @@ -1,11 +1,16 @@ -.label: 'Image style effect' +.meta: + label: 'Image style effect' name: - .label: 'Style name' - .type: string + .meta: + label: 'Style name' + type: string data: - .label: 'Data' + .meta: + label: 'Data' weight: - .label: 'Weight' - .type: integer + .meta: + label: 'Weight' + type: integer ieid: - .label: 'IEID' + .meta: + label: 'IEID' diff -u b/core/modules/image/meta/image.style.effects.image_scale.yml b/core/modules/image/meta/image.style.effects.image_scale.yml --- b/core/modules/image/meta/image.style.effects.image_scale.yml +++ b/core/modules/image/meta/image.style.effects.image_scale.yml @@ -1,20 +1,28 @@ -.label: 'Image scale' +.meta: + label: 'Image scale' name: - .label: 'Style name' - .type: string + .meta: + label: 'Machine name' + type: string weight: - .label: 'Weight' - .type: integer + .meta: + label: 'Weight' + type: integer ieid: - .label: 'IEID' + .meta: + label: 'IEID' data: - .label: 'Data' + .meta: + label: 'Data' width: - .label: 'Width' - .type: 'integer' + .meta: + label: 'Width' + type: 'integer' height: - .label: 'Height' - .type: 'integer' + .meta: + label: 'Height' + type: 'integer' upscale: - .label: 'Upscale' - .type: 'boolean' + .meta: + label: 'Upscale' + type: 'boolean' diff -u b/core/modules/locale/lib/Drupal/locale/LocaleTypedConfig.php b/core/modules/locale/lib/Drupal/locale/LocaleTypedConfig.php --- b/core/modules/locale/lib/Drupal/locale/LocaleTypedConfig.php +++ b/core/modules/locale/lib/Drupal/locale/LocaleTypedConfig.php @@ -11,7 +11,6 @@ use Drupal\Core\Config\Metadata\TypedConfig; use Drupal\Core\Config\Metadata\ElementInterface; use Drupal\Core\TypedData\TranslatableInterface; -use InvalidArgumentException; /** * Defines the locale configuration wrapper object. @@ -31,14 +30,14 @@ /** * Configuration wrapper used as translation source. * - * @var Drupal\Core\Config\Metadata\TypedConfig + * @var \Drupal\locale\LocaleTypedConfig */ protected $translationSource; /** * String storage object that will be used for translations. * - * @var Drupal\locale\StringStorageInterface $localeStorage + * @var \Drupal\locale\StringStorageInterface $localeStorage */ protected $localeStorage; @@ -56,10 +55,10 @@ * The configuration object name. * @param array $data * The configuration data. - * @param Drupal\locale\StringStorageInterface $localeStorage; + * @param \Drupal\locale\StringStorageInterface $localeStorage; * (optional) Locale string storage object that will be used for translations. */ - public function __construct($name, $data, $localeStorage = NULL) { + public function __construct($name, $data, StringStorageInterface $localeStorage = NULL) { parent::__construct($name, $data); $this->localeStorage = $localeStorage; } @@ -69,10 +68,10 @@ * * @param string $langcode * The language code for the translation. - * @param Drupal\Core\Config\Metadata\TypedConfig $source + * @param \Drupal\locale\LocaleTypedConfig $source * Configuration wrapper used as translation source. */ - public function setTranslation($langcode, $source) { + public function setTranslation($langcode, LocaleTypedConfig $source) { $this->translationLangcode = $langcode; $this->translationSource = $source; return $this; @@ -106,7 +105,7 @@ $languages[$default->langcode] = $default; } else { - unset($language[$default->langcode]); + unset($languages[$default->langcode]); } return $languages; } @@ -124,7 +123,6 @@ 'target' => $langcode, 'strict' => $strict, ); - //$data = $source->getTranslatedData($this, $options); $data = $this->getTranslatedData($this->get(), $options); $translation = new LocaleTypedConfig($this->name, $data); $translation->setTranslation($langcode, $strict, $this); @@ -147,7 +145,7 @@ /** * Get translated configuration data. * - * @param Traversable $elements + * @param \Traversable $elements * Configuration elements. * @param array $options * Array with options that will depend on the translator used. @@ -183,7 +181,7 @@ * 'text'. Translatable elements may define the string context by using the * 'locale context' key under the element definition's 'constraints'. * - * @param Drupal\Core\TypedData\TypedDataInterface $element + * @param \Drupal\Core\TypedData\TypedDataInterface $element * Configuration element. * @param array $options * Array with translation options that are dependent on the translator. @@ -222,7 +220,7 @@ * @param string $context * The string context. * - * @return string|FALSE + * @return string|bool * Translated string if there is a translation, FALSE if not. */ protected function translateString($langcode, $source, $context) { @@ -238,7 +236,7 @@ if ($translation = $this->localeStorage->findTranslation(array('source' => $source, 'context' => $context, 'language' => $langcode))) { // The translation was there but the location was missing. // Convert to SourceString because it may not have translation. - $string = $this->localeStorage->createString((array)$translation) + $string = $this->localeStorage->createString((array) $translation) ->addLocation('configuration', $this->name) ->save(); } diff -u b/core/modules/locale/lib/Drupal/locale/StringBase.php b/core/modules/locale/lib/Drupal/locale/StringBase.php --- b/core/modules/locale/lib/Drupal/locale/StringBase.php +++ b/core/modules/locale/lib/Drupal/locale/StringBase.php @@ -52,7 +52,7 @@ /** * The locale storage this string comes from or is to be saved to. * - * @var Drupal\locale\StringStorageInterface + * @var \Drupal\locale\StringStorageInterface */ protected $storage; diff -u b/core/modules/system/meta/system.maintenance.yml b/core/modules/system/meta/system.maintenance.yml --- b/core/modules/system/meta/system.maintenance.yml +++ b/core/modules/system/meta/system.maintenance.yml @@ -2,5 +2,7 @@ - .label: 'Put site into maintenance mode' - .type: boolean + .meta: + label: 'Put site into maintenance mode' + type: boolean message: - .label: 'Message to display when in maintenance mode' - .type: text + .meta: + label: 'Message to display when in maintenance mode' + type: text diff -u b/core/modules/system/meta/system.site.yml b/core/modules/system/meta/system.site.yml --- b/core/modules/system/meta/system.site.yml +++ b/core/modules/system/meta/system.site.yml @@ -2,15 +2,22 @@ - .label: 'Site name' - .type: text + .meta: + label: 'Site name' + type: text mail: - .label: 'Site mail' + .meta: + label: 'Site mail' slogan: - .label: 'Site slogan' - .type: text + .meta: + label: 'Site slogan' + type: text page: - .label: 'Default pages' + .meta: + label: 'Default pages' 403: - .label: 'Default 403 (access denied) page' + .meta: + label: 'Default 403 (access denied) page' 404: - .label: 'Default 404 (not found) page' + .meta: + label: 'Default 404 (not found) page' front: - .label: 'Default front page' + .meta: + label: 'Default front page' diff -u b/core/modules/user/meta/user.mail.%.yml b/core/modules/user/meta/user.mail.%.yml --- b/core/modules/user/meta/user.mail.%.yml +++ b/core/modules/user/meta/user.mail.%.yml @@ -1,7 +1,10 @@ -.label: 'Mail text' +.meta: + label: 'Mail text' subject: - .label: 'Subject' - .type: 'text' + .meta: + label: 'Subject' + type: 'text' body: - .label: 'Body' - .type: 'text' + .meta: + label: 'Body' + type: 'text' diff -u b/core/modules/user/meta/user.mail.yml b/core/modules/user/meta/user.mail.yml --- b/core/modules/user/meta/user.mail.yml +++ b/core/modules/user/meta/user.mail.yml @@ -1,4 +1,5 @@ -.label: 'User mails' -.list: '1' -.list settings: - elements name: 'user.mail.%' +.meta: + label: 'User mails' + list: '1' + list settings: + elements name: 'user.mail.%' only in patch2: unchanged: --- a/core/lib/Drupal/Core/Config/Config.php +++ b/core/lib/Drupal/Core/Config/Config.php @@ -323,7 +323,7 @@ public function clear($key) { /** * Loads configuration data into this object. * - * @return Drupal\Core\Config\Config + * @return \Drupal\Core\Config\Config * The configuration object. */ public function load() { only in patch2: unchanged: --- a/core/lib/Drupal/Core/Config/ConfigFactory.php +++ b/core/lib/Drupal/Core/Config/ConfigFactory.php @@ -58,7 +58,7 @@ public function __construct(StorageInterface $storage, EventDispatcher $event_di * @param string $name * The name of the configuration object to construct. * - * @return Drupal\Core\Config\Config + * @return \Drupal\Core\Config\Config * A configuration object with the given $name. */ public function get($name) { only in patch2: unchanged: --- /dev/null +++ b/core/lib/Drupal/Core/Config/Metadata/TypedConfigFactory.php @@ -0,0 +1,41 @@ +configFactory = $config_factory; + } + + /** + * Returns configuration wrapper object to access data as typed properties. + * + * @param string $name + * @return TypedConfig + */ + function get($name) { + return new TypedConfig($name, $this->configFactory->get($name)->load()->get()); + } + +} only in patch2: unchanged: --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -68,6 +68,13 @@ public function build(ContainerBuilder $container) { $container->register('entity.query', 'Drupal\Core\Entity\Query\QueryFactory') ->addArgument(new Reference('service_container')); + // Add the config metadata service. + $container->register('config.metadata.storage', 'Drupal\Core\Config\Metadata\MetadataStorage'); + $container->register('config.metadata', 'Drupal\Core\Config\Metadata\MetadataLookup') + ->addArgument(new Reference('config.metadata.storage')); + $container->register('config.typed', 'Drupal\Core\Config\Metadata\TypedConfigFactory') + ->addArgument(new Reference('config.factory')); + $container->register('router.dumper', 'Drupal\Core\Routing\MatcherDumper') ->addArgument(new Reference('database')); $container->register('router.builder', 'Drupal\Core\Routing\RouteBuilder') only in patch2: unchanged: --- a/core/modules/locale/lib/Drupal/locale/StringStorageInterface.php +++ b/core/modules/locale/lib/Drupal/locale/StringStorageInterface.php @@ -79,7 +79,7 @@ public function getLocations(array $conditions = array()); * (optional) Array with conditions that will be used to filter the strings * returned and may include all of the conditions defined by getStrings(). * - * @return Drupal\locale\SourceString|null + * @return \Drupal\locale\SourceString|null * Minimal TranslationString object if found, NULL otherwise. */ public function findString(array $conditions); @@ -95,7 +95,7 @@ public function findString(array $conditions); * (optional) Array with conditions that will be used to filter the strings * returned and may include all of the conditions defined by getStrings(). * - * @return Drupal\locale\TranslationString|null + * @return \Drupal\locale\TranslationString|null * Minimal TranslationString object if found, NULL otherwise. */ public function findTranslation(array $conditions); @@ -103,13 +103,13 @@ public function findTranslation(array $conditions); /** * Save string object to storage. * - * @param Drupal\locale\StringInterface $string + * @param \Drupal\locale\StringInterface $string * The string object. * - * @return Drupal\locale\StringStorageInterface + * @return \Drupal\locale\StringStorageInterface * The called object. * - * @throws Drupal\locale\StringStorageException + * @throws \Drupal\locale\StringStorageException * In case of failures, an exception is thrown. */ public function save($string); @@ -117,13 +117,13 @@ public function save($string); /** * Delete string from storage. * - * @param Drupal\locale\StringInterface $string + * @param \Drupal\locale\StringInterface $string * The string object. * - * @return Drupal\locale\StringStorageInterface + * @return \Drupal\locale\StringStorageInterface * The called object. * - * @throws Drupal\locale\StringStorageException + * @throws \Drupal\locale\StringStorageException * In case of failures, an exception is thrown. */ public function delete($string); @@ -166,7 +166,7 @@ public function countTranslations(); * @param array $values * (optional) Array with initial values. Defaults to empty array. * - * @return Drupal\locale\SourceString + * @return \Drupal\locale\SourceString * New source string object. */ public function createString($values = array()); @@ -177,7 +177,7 @@ public function createString($values = array()); * @param array $values * (optional) Array with initial values. Defaults to empty array. * - * @return Drupal\locale\TranslationString + * @return \Drupal\locale\TranslationString * New string translation object. */ public function createTranslation($values = array());