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 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Lock\DatabaseLockBackend;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Session\AnonymousUserSession;
......@@ -1812,8 +1813,8 @@ function language($type) {
*
* @param $flags
* (optional) Specifies the state of the languages that have to be returned.
* It can be: Language::STATE_CONFIGURABLE, Language::STATE_LOCKED,
* Language::STATE_ALL.
* It can be: LanguageInterface::STATE_CONFIGURABLE,
* LanguageInterface::STATE_LOCKED, LanguageInterface::STATE_ALL.
*
* @return array
* An associative array of languages, keyed by the language code, ordered by
......@@ -1822,7 +1823,7 @@ function language($type) {
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal::languageManager()->getLanguages().
*/
function language_list($flags = Language::STATE_CONFIGURABLE) {
function language_list($flags = LanguageInterface::STATE_CONFIGURABLE) {
return \Drupal::languageManager()->getLanguages($flags);
}
......@@ -1832,7 +1833,7 @@ function language_list($flags = Language::STATE_CONFIGURABLE) {
* @param string $langcode
* The language code.
*
* @return \Drupal\core\Language\Language|null
* @return \Drupal\core\Language\LanguageInterface|null
* A fully-populated language object or NULL.
*
* @see \Drupal\Core\Language\LanguageManager::getLanguage()
......@@ -1847,7 +1848,7 @@ function language_load($langcode) {
/**
* Returns the default language used on the site.
*
* @return \Drupal\Core\Language\Language
* @return \Drupal\Core\Language\LanguageInterface
* A language object.
*
* @see \Drupal\Core\Language\LanguageManager::getLanguage()
......
......@@ -19,7 +19,7 @@
use Drupal\Component\Utility\Tags;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
......@@ -415,7 +415,7 @@ function check_url($uri) {
* Arbitrary elements may be added using the $args associative 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 .= ' <title>' . String::checkPlain($title) . "</title>\n";
......@@ -1773,7 +1773,7 @@ function _drupal_add_js($data = NULL, $options = NULL) {
'currentPath' => $current_path,
'currentPathIsAdmin' => $current_path_is_admin,
'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)) {
ksort($current_query);
......
......@@ -8,7 +8,6 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Language\Language;
/**
* Clears the entity render cache for all entity types.
......
......@@ -12,7 +12,6 @@
use Drupal\Component\Utility\Xss;
use Drupal\Core\Database\Database;
use Drupal\Core\Form\OptGroup;
use Drupal\Core\Language\Language;
use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute;
use Drupal\Core\Utility\Color;
......
......@@ -7,7 +7,6 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
......
......@@ -13,7 +13,6 @@
use Drupal\Component\Utility\Xss;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\StorageException;
use Drupal\Core\Language\Language;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionNameLengthException;
use Drupal\Core\Page\FeedLinkElement;
......
......@@ -800,14 +800,14 @@ function update_replace_permissions($replace) {
*
* @param $flags
* (optional) Specifies the state of the languages that have to be returned.
* It can be: Language::STATE_CONFIGURABLE, Language::STATE_LOCKED,
* Language::STATE_ALL.
* It can be: LanguageInterface::STATE_CONFIGURABLE,
* LanguageInterface::STATE_LOCKED, LanguageInterface::STATE_ALL.
*
* @return array
* An associative array of languages, keyed by the language code, ordered by
* 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__);
......@@ -853,7 +853,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) {
$filtered_languages = array();
// 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();
// Rename the default language.
$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) {
}
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;
}
$filtered_languages[$langcode] = $language;
......
......@@ -461,7 +461,8 @@ public static function urlGenerator() {
* displayed outside the site, such as in an RSS feed.
* - 'language': An optional language object used to look up the alias
* 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
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
......
......@@ -7,7 +7,6 @@
namespace Drupal\Core\Config;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageDefault;
/**
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Config;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Symfony\Component\EventDispatcher\Event;
/**
......@@ -33,7 +33,7 @@ class ConfigModuleOverridesEvent extends Event {
/**
* The Language object used to override configuration data.
*
* @var \Drupal\Core\Language\Language
* @var \Drupal\Core\Language\LanguageInterface
*/
protected $language;
......@@ -42,10 +42,10 @@ class ConfigModuleOverridesEvent extends Event {
*
* @param array $names
* A list of configuration names.
* @param \Drupal\Core\Language\Language
* @param \Drupal\Core\Language\LanguageInterface
* (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->language = $language;
$this->overrides = array();
......@@ -64,7 +64,7 @@ public function getNames() {
/**
* Gets configuration language.
*
* @return \Drupal\Core\Language\Language
* @return \Drupal\Core\Language\LanguageInterface
* The configuration language object.
*/
public function getLanguage() {
......
......@@ -14,7 +14,7 @@
use Drupal\Core\Config\ConfigDuplicateUUIDException;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityWithPluginBagsInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Plugin\PluginDependencyTrait;
/**
......@@ -83,7 +83,7 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
*
* @var string
*/
public $langcode = Language::LANGCODE_NOT_SPECIFIED;
public $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
/**
* Overrides Entity::__construct().
......
......@@ -7,7 +7,6 @@
namespace Drupal\Core\Datetime;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Language\Language;
/**
* Extends DateTimePlus().
......
......@@ -10,7 +10,7 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\Plugin\DataType\EntityReference;
use Drupal\Core\Entity\TypedData\EntityDataDefinition;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TypedData\TypedDataInterface;
......@@ -38,8 +38,8 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
* The plain data values of the contained fields.
*
* This always holds the original, unchanged values of the entity. The values
* are keyed by language code, whereas Language::LANGCODE_DEFAULT is used for
* values in default language.
* are keyed by language code, whereas LanguageInterface::LANGCODE_DEFAULT
* is used for values in default language.
*
* @todo: Add methods for getting original fields and for determining
* changes.
......@@ -80,7 +80,7 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
*
* @var string
*/
protected $activeLangcode = Language::LANGCODE_DEFAULT;
protected $activeLangcode = LanguageInterface::LANGCODE_DEFAULT;
/**
* Local cache for the default language code.
......@@ -141,22 +141,22 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
public function __construct(array $values, $entity_type, $bundle = FALSE, $translations = array()) {
$this->entityTypeId = $entity_type;
$this->entityKeys['bundle'] = $bundle ? $bundle : $this->entityTypeId;
$this->languages = $this->languageManager()->getLanguages(Language::STATE_ALL);
$this->languages = $this->languageManager()->getLanguages(LanguageInterface::STATE_ALL);
foreach ($values as $key => $value) {
// If the key matches an existing property set the value to the property
// to set properties like isDefaultRevision.
// @todo: Should this be converted somehow?
if (property_exists($this, $key) && isset($value[Language::LANGCODE_DEFAULT])) {
$this->$key = $value[Language::LANGCODE_DEFAULT];
if (property_exists($this, $key) && isset($value[LanguageInterface::LANGCODE_DEFAULT])) {
$this->$key = $value[LanguageInterface::LANGCODE_DEFAULT];
}
}
$this->values = $values;
foreach ($this->getEntityType()->getKeys() as $key => $field_name) {
if (isset($this->values[$field_name])) {
if (is_array($this->values[$field_name]) && isset($this->values[$field_name][Language::LANGCODE_DEFAULT])) {
$this->entityKeys[$key] = $this->values[$field_name][Language::LANGCODE_DEFAULT];
if (is_array($this->values[$field_name]) && isset($this->values[$field_name][LanguageInterface::LANGCODE_DEFAULT])) {
$this->entityKeys[$key] = $this->values[$field_name][LanguageInterface::LANGCODE_DEFAULT];
}
}
}
......@@ -164,11 +164,11 @@ public function __construct(array $values, $entity_type, $bundle = FALSE, $trans
// Initialize translations. Ensure we have at least an entry for the default
// language.
$data = array('status' => static::TRANSLATION_EXISTING);
$this->translations[Language::LANGCODE_DEFAULT] = $data;
$this->translations[LanguageInterface::LANGCODE_DEFAULT] = $data;
$this->setDefaultLangcode();
if ($translations) {
foreach ($translations as $langcode) {
if ($langcode != $this->defaultLangcode && $langcode != Language::LANGCODE_DEFAULT) {
if ($langcode != $this->defaultLangcode && $langcode != LanguageInterface::LANGCODE_DEFAULT) {
$this->translations[$langcode] = $data;
}
}
......@@ -427,14 +427,14 @@ protected function getTranslatedField($name, $langcode) {
throw new \InvalidArgumentException('Field ' . String::checkPlain($name) . ' is unknown.');
}
// Non-translatable fields are always stored with
// Language::LANGCODE_DEFAULT as key.
// LanguageInterface::LANGCODE_DEFAULT as key.
$default = $langcode == Language::LANGCODE_DEFAULT;
$default = $langcode == LanguageInterface::LANGCODE_DEFAULT;
if (!$default && !$definition->isTranslatable()) {
if (!isset($this->fields[$name][Language::LANGCODE_DEFAULT])) {
$this->fields[$name][Language::LANGCODE_DEFAULT] = $this->getTranslatedField($name, Language::LANGCODE_DEFAULT);
if (!isset($this->fields[$name][LanguageInterface::LANGCODE_DEFAULT])) {
$this->fields[$name][LanguageInterface::LANGCODE_DEFAULT] = $this->getTranslatedField($name, LanguageInterface::LANGCODE_DEFAULT);
}
$this->fields[$name][$langcode] = &$this->fields[$name][Language::LANGCODE_DEFAULT];
$this->fields[$name][$langcode] = &$this->fields[$name][LanguageInterface::LANGCODE_DEFAULT];
}
else {
$value = NULL;
......@@ -446,7 +446,7 @@ protected function getTranslatedField($name, $langcode) {
// $this->defaultLangcode might not be set if we are initializing the
// default language code cache, in which case there is no valid
// langcode to assign.
$field_langcode = isset($this->defaultLangcode) ? $this->defaultLangcode : Language::LANGCODE_NOT_SPECIFIED;
$field_langcode = isset($this->defaultLangcode) ? $this->defaultLangcode : LanguageInterface::LANGCODE_NOT_SPECIFIED;
}
else {
$field_langcode = $langcode;
......@@ -554,9 +554,9 @@ public function access($operation, AccountInterface $account = NULL) {
*/
public function language() {
$language = NULL;
if ($this->activeLangcode != Language::LANGCODE_DEFAULT) {
if ($this->activeLangcode != LanguageInterface::LANGCODE_DEFAULT) {
if (!isset($this->languages[$this->activeLangcode])) {
$this->languages += $this->languageManager()->getLanguages(Language::STATE_ALL);
$this->languages += $this->languageManager()->getLanguages(LanguageInterface::STATE_ALL);
}
$language = $this->languages[$this->activeLangcode];
}
......@@ -576,25 +576,22 @@ protected function setDefaultLangcode() {
}
if (empty($this->defaultLangcode)) {
// Make sure we return a proper language object.
$this->defaultLangcode = Language::LANGCODE_NOT_SPECIFIED;
$this->defaultLangcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
}
// This needs to be initialized manually as it is skipped when instantiating
// the language field object to avoid infinite recursion.
if (!empty($this->fields['langcode'])) {
$this->fields['langcode'][Language::LANGCODE_DEFAULT]->setLangcode($this->defaultLangcode);
$this->fields['langcode'][LanguageInterface::LANGCODE_DEFAULT]->setLangcode($this->defaultLangcode);
}
}
/**
* Updates language for already instantiated fields.
*
* @return \Drupal\Core\Language\Language
* A language object.
*/
protected function updateFieldLangcodes($langcode) {
foreach ($this->fields as $name => $items) {
if (!empty($items[Language::LANGCODE_DEFAULT])) {
$items[Language::LANGCODE_DEFAULT]->setLangcode($langcode);
if (!empty($items[LanguageInterface::LANGCODE_DEFAULT])) {
$items[LanguageInterface::LANGCODE_DEFAULT]->setLangcode($langcode);
}
}
}
......@@ -630,8 +627,8 @@ public function onChange($name) {
public function getTranslation($langcode) {
// Ensure we always use the default language code when dealing with the
// original entity language.
if ($langcode != Language::LANGCODE_DEFAULT && $langcode == $this->defaultLangcode) {
$langcode = Language::LANGCODE_DEFAULT;
if ($langcode != LanguageInterface::LANGCODE_DEFAULT && $langcode == $this->defaultLangcode) {
$langcode = LanguageInterface::LANGCODE_DEFAULT;
}
// Populate entity translation object cache so it will be available for all
......@@ -674,7 +671,7 @@ public function getTranslation($langcode) {
* {@inheritdoc}
*/
public function getUntranslated() {
return $this->getTranslation(Language::LANGCODE_DEFAULT);
return $this->getTranslation(LanguageInterface::LANGCODE_DEFAULT);
}
/**
......@@ -721,7 +718,7 @@ protected function initializeTranslation($langcode) {
*/
public function hasTranslation($langcode) {
if ($langcode == $this->defaultLangcode) {
$langcode = Language::LANGCODE_DEFAULT;
$langcode = LanguageInterface::LANGCODE_DEFAULT;
}
return !empty($this->translations[$langcode]['status']);
}
......@@ -766,7 +763,7 @@ public function addTranslation($langcode, array $values = array()) {
* {@inheritdoc}
*/
public function removeTranslation($langcode) {
if (isset($this->translations[$langcode]) && $langcode != Language::LANGCODE_DEFAULT && $langcode != $this->defaultLangcode) {
if (isset($this->translations[$langcode]) && $langcode != LanguageInterface::LANGCODE_DEFAULT && $langcode != $this->defaultLangcode) {
foreach ($this->getFieldDefinitions() as $name => $definition) {
if ($definition->isTranslatable()) {
unset($this->values[$name][$langcode]);
......@@ -785,7 +782,7 @@ public function removeTranslation($langcode) {
* {@inheritdoc}
*/
public function initTranslation($langcode) {
if ($langcode != Language::LANGCODE_DEFAULT && $langcode != $this->defaultLangcode) {
if ($langcode != LanguageInterface::LANGCODE_DEFAULT && $langcode != $this->defaultLangcode) {
$this->translations[$langcode]['status'] = static::TRANSLATION_EXISTING;
}
}
......@@ -795,7 +792,7 @@ public function initTranslation($langcode) {
*/
public function getTranslationLanguages($include_default = TRUE) {
$translations = array_filter($this->translations, function($translation) { return $translation['status']; });
unset($translations[Language::LANGCODE_DEFAULT]);
unset($translations[LanguageInterface::LANGCODE_DEFAULT]);
if ($include_default) {
$translations[$this->defaultLangcode] = TRUE;
......@@ -957,7 +954,7 @@ public function __clone() {
// we retain just the original value, as references will be recreated
// later as needed.
if (!$definitions[$name]->isTranslatable() && count($values) > 1) {
$values = array_intersect_key($values, array(Language::LANGCODE_DEFAULT => TRUE));
$values = array_intersect_key($values, array(LanguageInterface::LANGCODE_DEFAULT => TRUE));
}
foreach ($values as $langcode => $items) {
$this->fields[$name][$langcode] = clone $items;
......
......@@ -16,7 +16,7 @@
use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\field\FieldConfigUpdateForbiddenException;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface;
......@@ -381,12 +381,12 @@ protected function mapFromStorageRecords(array $records) {
// that store several properties).
if ($field_name = strstr($name, '__', TRUE)) {
$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 {
// Handle columns named directly after the field (e.g if the field
// 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
......@@ -427,7 +427,7 @@ protected function attachPropertyData(array &$entities) {
// Get the revision IDs.
$revision_ids = array();
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);
}
......@@ -447,8 +447,8 @@ protected function attachPropertyData(array &$entities) {
$id = $values[$this->idKey];
// Field values in default language are stored with
// Language::LANGCODE_DEFAULT as key.
$langcode = empty($values['default_langcode']) ? $values['langcode'] : Language::LANGCODE_DEFAULT;
// LanguageInterface::LANGCODE_DEFAULT as key.
$langcode = empty($values['default_langcode']) ? $values['langcode'] : LanguageInterface::LANGCODE_DEFAULT;
$translations[$id][$langcode] = TRUE;
......@@ -467,7 +467,7 @@ protected function attachPropertyData(array &$entities) {
}
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.
$entities[$id] = new $this->entityClass($values, $this->entityTypeId, $bundle, array_keys($translations[$id]));
}
......@@ -962,7 +962,7 @@ protected function doLoadFieldItems($entities, $age) {
}
// 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) {
$table = $load_current ? static::_fieldTableName($field) : static::_fieldRevisionTableName($field);
......
......@@ -17,6 +17,7 @@
use Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException;
use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
......@@ -283,7 +284,7 @@ public function access($operation, AccountInterface $account = NULL) {
}
return $this->entityManager()
->getAccessController($this->entityTypeId)
->access($this, $operation, Language::LANGCODE_DEFAULT, $account);
->access($this, $operation, LanguageInterface::LANGCODE_DEFAULT, $account);
}
/**
......@@ -293,7 +294,7 @@ public function language() {
$language = $this->languageManager()->getLanguage($this->langcode);
if (!$language) {
// 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;
}
......
......@@ -11,7 +11,7 @@
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface;
/**
......@@ -54,7 +54,7 @@ public function __construct(EntityTypeInterface $entity_type) {
/**