Commit 49a90046 authored by webchick's avatar webchick

Issue #2246665 by jaredsmith, martin107, YesCT, filijonka, tstoeckler:...

Issue #2246665 by jaredsmith, martin107, YesCT, filijonka, tstoeckler: Typehint with Drupal\Core\Language\LanguageInterface instead Drupal\Core\Language\Language.
parent c81a6ef8
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Lock\DatabaseLockBackend; use Drupal\Core\Lock\DatabaseLockBackend;
use Drupal\Core\Lock\LockBackendInterface; use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Session\AnonymousUserSession; use Drupal\Core\Session\AnonymousUserSession;
...@@ -1812,8 +1813,8 @@ function language($type) { ...@@ -1812,8 +1813,8 @@ function language($type) {
* *
* @param $flags * @param $flags
* (optional) Specifies the state of the languages that have to be returned. * (optional) Specifies the state of the languages that have to be returned.
* It can be: Language::STATE_CONFIGURABLE, Language::STATE_LOCKED, * It can be: LanguageInterface::STATE_CONFIGURABLE,
* Language::STATE_ALL. * LanguageInterface::STATE_LOCKED, LanguageInterface::STATE_ALL.
* *
* @return array * @return array
* An associative array of languages, keyed by the language code, ordered by * An associative array of languages, keyed by the language code, ordered by
...@@ -1822,7 +1823,7 @@ function language($type) { ...@@ -1822,7 +1823,7 @@ function language($type) {
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal::languageManager()->getLanguages(). * Use \Drupal::languageManager()->getLanguages().
*/ */
function language_list($flags = Language::STATE_CONFIGURABLE) { function language_list($flags = LanguageInterface::STATE_CONFIGURABLE) {
return \Drupal::languageManager()->getLanguages($flags); return \Drupal::languageManager()->getLanguages($flags);
} }
...@@ -1832,7 +1833,7 @@ function language_list($flags = Language::STATE_CONFIGURABLE) { ...@@ -1832,7 +1833,7 @@ function language_list($flags = Language::STATE_CONFIGURABLE) {
* @param string $langcode * @param string $langcode
* The language code. * The language code.
* *
* @return \Drupal\core\Language\Language|null * @return \Drupal\core\Language\LanguageInterface|null
* A fully-populated language object or NULL. * A fully-populated language object or NULL.
* *
* @see \Drupal\Core\Language\LanguageManager::getLanguage() * @see \Drupal\Core\Language\LanguageManager::getLanguage()
...@@ -1847,7 +1848,7 @@ function language_load($langcode) { ...@@ -1847,7 +1848,7 @@ function language_load($langcode) {
/** /**
* Returns the default language used on the site. * Returns the default language used on the site.
* *
* @return \Drupal\Core\Language\Language * @return \Drupal\Core\Language\LanguageInterface
* A language object. * A language object.
* *
* @see \Drupal\Core\Language\LanguageManager::getLanguage() * @see \Drupal\Core\Language\LanguageManager::getLanguage()
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
use Drupal\Component\Utility\Tags; use Drupal\Component\Utility\Tags;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -415,7 +415,7 @@ function check_url($uri) { ...@@ -415,7 +415,7 @@ function check_url($uri) {
* Arbitrary elements may be added using the $args associative array. * Arbitrary elements may be added using the $args associative array.
*/ */
function format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array()) { function format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array()) {
$langcode = $langcode ? $langcode : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT)->id; $langcode = $langcode ? $langcode : \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->id;
$output = "<channel>\n"; $output = "<channel>\n";
$output .= ' <title>' . String::checkPlain($title) . "</title>\n"; $output .= ' <title>' . String::checkPlain($title) . "</title>\n";
...@@ -1773,7 +1773,7 @@ function _drupal_add_js($data = NULL, $options = NULL) { ...@@ -1773,7 +1773,7 @@ function _drupal_add_js($data = NULL, $options = NULL) {
'currentPath' => $current_path, 'currentPath' => $current_path,
'currentPathIsAdmin' => $current_path_is_admin, 'currentPathIsAdmin' => $current_path_is_admin,
'isFront' => drupal_is_front_page(), 'isFront' => drupal_is_front_page(),
'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_URL)->id, 'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->id,
); );
if (!empty($current_query)) { if (!empty($current_query)) {
ksort($current_query); ksort($current_query);
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Language\Language;
/** /**
* Clears the entity render cache for all entity types. * Clears the entity render cache for all entity types.
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
use Drupal\Component\Utility\Xss; use Drupal\Component\Utility\Xss;
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use Drupal\Core\Form\OptGroup; use Drupal\Core\Form\OptGroup;
use Drupal\Core\Language\Language;
use Drupal\Core\Render\Element; use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
use Drupal\Core\Utility\Color; use Drupal\Core\Utility\Color;
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
use Drupal\Core\Render\Element; use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface;
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
use Drupal\Component\Utility\Xss; use Drupal\Component\Utility\Xss;
use Drupal\Core\Config\Config; use Drupal\Core\Config\Config;
use Drupal\Core\Config\StorageException; use Drupal\Core\Config\StorageException;
use Drupal\Core\Language\Language;
use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionNameLengthException; use Drupal\Core\Extension\ExtensionNameLengthException;
use Drupal\Core\Page\FeedLinkElement; use Drupal\Core\Page\FeedLinkElement;
......
...@@ -800,14 +800,14 @@ function update_replace_permissions($replace) { ...@@ -800,14 +800,14 @@ function update_replace_permissions($replace) {
* *
* @param $flags * @param $flags
* (optional) Specifies the state of the languages that have to be returned. * (optional) Specifies the state of the languages that have to be returned.
* It can be: Language::STATE_CONFIGURABLE, Language::STATE_LOCKED, * It can be: LanguageInterface::STATE_CONFIGURABLE,
* Language::STATE_ALL. * LanguageInterface::STATE_LOCKED, LanguageInterface::STATE_ALL.
* *
* @return array * @return array
* An associative array of languages, keyed by the language code, ordered by * An associative array of languages, keyed by the language code, ordered by
* weight ascending and name ascending. * weight ascending and name ascending.
*/ */
function update_language_list($flags = Language::STATE_CONFIGURABLE) { function update_language_list($flags = LanguageInterface::STATE_CONFIGURABLE) {
$languages = &drupal_static(__FUNCTION__); $languages = &drupal_static(__FUNCTION__);
...@@ -853,7 +853,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) { ...@@ -853,7 +853,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) {
$filtered_languages = array(); $filtered_languages = array();
// Add the site's default language if flagged as allowed value. // Add the site's default language if flagged as allowed value.
if ($flags & Language::STATE_SITE_DEFAULT) { if ($flags & LanguageInterface::STATE_SITE_DEFAULT) {
$default = isset($default) ? $default : \Drupal::languageManager()->getDefaultLanguage(); $default = isset($default) ? $default : \Drupal::languageManager()->getDefaultLanguage();
// Rename the default language. // Rename the default language.
$default->name = t("Site's default language (@lang_name)", array('@lang_name' => $default->name)); $default->name = t("Site's default language (@lang_name)", array('@lang_name' => $default->name));
...@@ -861,7 +861,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) { ...@@ -861,7 +861,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) {
} }
foreach ($languages as $langcode => $language) { foreach ($languages as $langcode => $language) {
if (($language->locked && !($flags & Language::STATE_LOCKED)) || (!$language->locked && !($flags & Language::STATE_CONFIGURABLE))) { if (($language->locked && !($flags & LanguageInterface::STATE_LOCKED)) || (!$language->locked && !($flags & LanguageInterface::STATE_CONFIGURABLE))) {
continue; continue;
} }
$filtered_languages[$langcode] = $language; $filtered_languages[$langcode] = $language;
......
...@@ -461,7 +461,8 @@ public static function urlGenerator() { ...@@ -461,7 +461,8 @@ public static function urlGenerator() {
* displayed outside the site, such as in an RSS feed. * displayed outside the site, such as in an RSS feed.
* - 'language': An optional language object used to look up the alias * - 'language': An optional language object used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be * for the URL. If $options['language'] is omitted, the language will be
* obtained from \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_URL). * obtained from
* \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not * - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS * defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS * respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
namespace Drupal\Core\Config; namespace Drupal\Core\Config;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageDefault; use Drupal\Core\Language\LanguageDefault;
/** /**
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace Drupal\Core\Config; namespace Drupal\Core\Config;
use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface;
use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\Event;
/** /**
...@@ -33,7 +33,7 @@ class ConfigModuleOverridesEvent extends Event { ...@@ -33,7 +33,7 @@ class ConfigModuleOverridesEvent extends Event {
/** /**
* The Language object used to override configuration data. * The Language object used to override configuration data.
* *
* @var \Drupal\Core\Language\Language * @var \Drupal\Core\Language\LanguageInterface
*/ */
protected $language; protected $language;
...@@ -42,10 +42,10 @@ class ConfigModuleOverridesEvent extends Event { ...@@ -42,10 +42,10 @@ class ConfigModuleOverridesEvent extends Event {
* *
* @param array $names * @param array $names
* A list of configuration names. * A list of configuration names.
* @param \Drupal\Core\Language\Language * @param \Drupal\Core\Language\LanguageInterface
* (optional) The language for this configuration. * (optional) The language for this configuration.
*/ */
public function __construct(array $names, Language $language = NULL) { public function __construct(array $names, LanguageInterface $language = NULL) {
$this->names = $names; $this->names = $names;
$this->language = $language; $this->language = $language;
$this->overrides = array(); $this->overrides = array();
...@@ -64,7 +64,7 @@ public function getNames() { ...@@ -64,7 +64,7 @@ public function getNames() {
/** /**
* Gets configuration language. * Gets configuration language.
* *
* @return \Drupal\Core\Language\Language * @return \Drupal\Core\Language\LanguageInterface
* The configuration language object. * The configuration language object.
*/ */
public function getLanguage() { public function getLanguage() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
use Drupal\Core\Config\ConfigDuplicateUUIDException; use Drupal\Core\Config\ConfigDuplicateUUIDException;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityWithPluginBagsInterface; use Drupal\Core\Entity\EntityWithPluginBagsInterface;
use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Plugin\PluginDependencyTrait; use Drupal\Core\Plugin\PluginDependencyTrait;
/** /**
...@@ -83,7 +83,7 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface ...@@ -83,7 +83,7 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
* *
* @var string * @var string
*/ */
public $langcode = Language::LANGCODE_NOT_SPECIFIED; public $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
/** /**
* Overrides Entity::__construct(). * Overrides Entity::__construct().
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
namespace Drupal\Core\Datetime; namespace Drupal\Core\Datetime;
use Drupal\Component\Datetime\DateTimePlus; use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Language\Language;
/** /**
* Extends DateTimePlus(). * Extends DateTimePlus().
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface;
use Drupal\field\FieldConfigUpdateForbiddenException; use Drupal\field\FieldConfigUpdateForbiddenException;
use Drupal\field\FieldConfigInterface; use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface; use Drupal\field\FieldInstanceConfigInterface;
...@@ -381,12 +381,12 @@ protected function mapFromStorageRecords(array $records) { ...@@ -381,12 +381,12 @@ protected function mapFromStorageRecords(array $records) {
// that store several properties). // that store several properties).
if ($field_name = strstr($name, '__', TRUE)) { if ($field_name = strstr($name, '__', TRUE)) {
$property_name = substr($name, strpos($name, '__') + 2); $property_name = substr($name, strpos($name, '__') + 2);
$entities[$id][$field_name][Language::LANGCODE_DEFAULT][$property_name] = $value; $entities[$id][$field_name][LanguageInterface::LANGCODE_DEFAULT][$property_name] = $value;
} }
else { else {
// Handle columns named directly after the field (e.g if the field // Handle columns named directly after the field (e.g if the field
// type only stores one property). // type only stores one property).
$entities[$id][$name][Language::LANGCODE_DEFAULT] = $value; $entities[$id][$name][LanguageInterface::LANGCODE_DEFAULT] = $value;
} }
} }
// If we have no multilingual values we can instantiate entity objecs // If we have no multilingual values we can instantiate entity objecs
...@@ -427,7 +427,7 @@ protected function attachPropertyData(array &$entities) { ...@@ -427,7 +427,7 @@ protected function attachPropertyData(array &$entities) {
// Get the revision IDs. // Get the revision IDs.
$revision_ids = array(); $revision_ids = array();
foreach ($entities as $values) { foreach ($entities as $values) {
$revision_ids[] = is_object($values) ? $values->getRevisionId() : $values[$this->revisionKey][Language::LANGCODE_DEFAULT]; $revision_ids[] = is_object($values) ? $values->getRevisionId() : $values[$this->revisionKey][LanguageInterface::LANGCODE_DEFAULT];
} }
$query->condition($this->revisionKey, $revision_ids); $query->condition($this->revisionKey, $revision_ids);
} }
...@@ -447,8 +447,8 @@ protected function attachPropertyData(array &$entities) { ...@@ -447,8 +447,8 @@ protected function attachPropertyData(array &$entities) {
$id = $values[$this->idKey]; $id = $values[$this->idKey];
// Field values in default language are stored with // Field values in default language are stored with
// Language::LANGCODE_DEFAULT as key. // LanguageInterface::LANGCODE_DEFAULT as key.
$langcode = empty($values['default_langcode']) ? $values['langcode'] : Language::LANGCODE_DEFAULT; $langcode = empty($values['default_langcode']) ? $values['langcode'] : LanguageInterface::LANGCODE_DEFAULT;
$translations[$id][$langcode] = TRUE; $translations[$id][$langcode] = TRUE;
...@@ -467,7 +467,7 @@ protected function attachPropertyData(array &$entities) { ...@@ -467,7 +467,7 @@ protected function attachPropertyData(array &$entities) {
} }
foreach ($entities as $id => $values) { foreach ($entities as $id => $values) {
$bundle = $this->bundleKey ? $values[$this->bundleKey][Language::LANGCODE_DEFAULT] : FALSE; $bundle = $this->bundleKey ? $values[$this->bundleKey][LanguageInterface::LANGCODE_DEFAULT] : FALSE;
// Turn the record into an entity class. // Turn the record into an entity class.
$entities[$id] = new $this->entityClass($values, $this->entityTypeId, $bundle, array_keys($translations[$id])); $entities[$id] = new $this->entityClass($values, $this->entityTypeId, $bundle, array_keys($translations[$id]));
} }
...@@ -962,7 +962,7 @@ protected function doLoadFieldItems($entities, $age) { ...@@ -962,7 +962,7 @@ protected function doLoadFieldItems($entities, $age) {
} }
// Load field data. // Load field data.
$langcodes = array_keys(language_list(Language::STATE_ALL)); $langcodes = array_keys(language_list(LanguageInterface::STATE_ALL));
foreach ($fields as $field_name => $field) { foreach ($fields as $field_name => $field) {
$table = $load_current ? static::_fieldTableName($field) : static::_fieldRevisionTableName($field); $table = $load_current ? static::_fieldTableName($field) : static::_fieldRevisionTableName($field);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
use Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException; use Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException;
use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException; use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException;
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url; use Drupal\Core\Url;
...@@ -283,7 +284,7 @@ public function access($operation, AccountInterface $account = NULL) { ...@@ -283,7 +284,7 @@ public function access($operation, AccountInterface $account = NULL) {
} }
return $this->entityManager() return $this->entityManager()
->getAccessController($this->entityTypeId) ->getAccessController($this->entityTypeId)
->access($this, $operation, Language::LANGCODE_DEFAULT, $account); ->access($this, $operation, LanguageInterface::LANGCODE_DEFAULT, $account);
} }
/** /**
...@@ -293,7 +294,7 @@ public function language() { ...@@ -293,7 +294,7 @@ public function language() {
$language = $this->languageManager()->getLanguage($this->langcode); $language = $this->languageManager()->getLanguage($this->langcode);
if (!$language) { if (!$language) {
// Make sure we return a proper language object. // Make sure we return a proper language object.
$language = new Language(array('id' => Language::LANGCODE_NOT_SPECIFIED)); $language = new Language(array('id' => LanguageInterface::LANGCODE_NOT_SPECIFIED));
} }
return $language; return $language;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
/** /**
...@@ -54,7 +54,7 @@ public function __construct(EntityTypeInterface $entity_type) { ...@@ -54,7 +54,7 @@ public function __construct(EntityTypeInterface $entity_type) {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function access(EntityInterface $entity, $operation, $langcode = Language::LANGCODE_DEFAULT, AccountInterface $account = NULL) { public function access(EntityInterface $entity, $operation, $langcode = LanguageInterface::LANGCODE_DEFAULT, AccountInterface $account = NULL) {
$account = $this->prepareUser($account); $account = $this->prepareUser($account);
if (($access = $this->getCache($entity->uuid(), $operation, $langcode, $account)) !== NULL) { if (($access = $this->getCache($entity->uuid(), $operation, $langcode, $account)) !== NULL) {
...@@ -203,7 +203,7 @@ public function resetCache() { ...@@ -203,7 +203,7 @@ public function resetCache() {
public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array()) { public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array()) {
$account = $this->prepareUser($account); $account = $this->prepareUser($account);
$context += array( $context += array(
'langcode' => Language::LANGCODE_DEFAULT, 'langcode' => LanguageInterface::LANGCODE_DEFAULT,
); );
$cid = $entity_bundle ? 'create:' . $entity_bundle : 'create'; $cid = $entity_bundle ? 'create:' . $entity_bundle : 'create';
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;