diff --git a/core/modules/language/lib/Drupal/language/DefaultLanguageItem.php b/core/modules/language/lib/Drupal/language/DefaultLanguageItem.php index fa74bc5..0ef14e2 100644 --- a/core/modules/language/lib/Drupal/language/DefaultLanguageItem.php +++ b/core/modules/language/lib/Drupal/language/DefaultLanguageItem.php @@ -38,6 +38,15 @@ public function applyDefaultValue($notify = TRUE) { return $this; } + /** + * Provides default language code of given entity. + * + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity whose language code to be loaded. + * + * @return string + * A string language code. + */ public function getDefaultLangcode(EntityInterface $entity) { return language_get_default_langcode($entity->getEntityTypeId(), $entity->bundle()); } diff --git a/core/modules/language/tests/Drupal/language/Tests/EntityDefaultLanguageTest.php b/core/modules/language/tests/Drupal/language/Tests/EntityDefaultLanguageTest.php index b96d4c7..0b2a3ca 100644 --- a/core/modules/language/tests/Drupal/language/Tests/EntityDefaultLanguageTest.php +++ b/core/modules/language/tests/Drupal/language/Tests/EntityDefaultLanguageTest.php @@ -22,6 +22,9 @@ class EntityDefaultLanguageTest extends DrupalUnitTestBase { */ public static $modules = array('language', 'node', 'field', 'text'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Entity default language', @@ -30,6 +33,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp();