diff --git a/core/lib/Drupal/Core/TypedData/TypedDataInterface.php b/core/lib/Drupal/Core/TypedData/TypedDataInterface.php index 0e63301..7b038e5 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataInterface.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataInterface.php @@ -26,7 +26,7 @@ * @param string|null $name * (optional) The name of the created property, or NULL if it is the root * of a typed data tree. Defaults to NULL. - * @param \Drupal\Core\TypedData\TypedDataInterface $parent + * @param \Drupal\Core\TypedData\TraversableTypedDataInterface $parent * (optional) The parent object of the data property, or NULL if it is the * root of a typed data tree. Defaults to NULL. * @@ -36,7 +36,7 @@ * * @see \Drupal\Core\TypedData\TypedDataManager::create() */ - public static function createInstance($definition, $name = NULL, TypedDataInterface $parent = NULL); + public static function createInstance($definition, $name = NULL, TraversableTypedDataInterface $parent = NULL); /** * Gets the data definition. @@ -159,9 +159,9 @@ public function getPropertyPath(); * @param string|null $name * (optional) The name of the property or the delta of the list item, * or NULL if it is the root of a typed data tree. Defaults to NULL. - * @param \Drupal\Core\TypedData\TypedDataInterface|null $parent + * @param \Drupal\Core\TypedData\TraversableTypedDataInterface|null $parent * (optional) The parent object of the data property, or NULL if it is the * root of a typed data tree. Defaults to NULL. */ - public function setContext($name = NULL, TypedDataInterface $parent = NULL); + public function setContext($name = NULL, TraversableTypedDataInterface $parent = NULL); } diff --git a/core/modules/locale/src/LocaleTypedConfig.php b/core/modules/locale/src/LocaleTypedConfig.php index f4c0138..ee0b470 100644 --- a/core/modules/locale/src/LocaleTypedConfig.php +++ b/core/modules/locale/src/LocaleTypedConfig.php @@ -127,7 +127,7 @@ protected function canTranslate($from_langcode, $to_langcode) { */ protected function getElementTranslation(TypedDataInterface $element, array $options) { $translation = array(); - if ($element instanceof \Traversable) { + if ($element instanceof TraversableTypedDataInterface) { $translation = $this->getArrayTranslation($element, $options); } elseif ($this->translateElement($element, $options)) {