diff --git a/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php index 29b8852..4e25563 100644 --- a/core/lib/Drupal/Core/Language/Language.php +++ b/core/lib/Drupal/Core/Language/Language.php @@ -70,7 +70,9 @@ class Language implements LanguageInterface { /** * The language negotiation method used when a language was detected. * - * @var bool + * The method ID, for example, LanguageNegotiatorInterface::METHOD_ID. + * + * @var string * * @see language_types_initialize() */ @@ -88,7 +90,7 @@ class Language implements LanguageInterface { public $locked = FALSE; /** - * Language constructor builds the default language object. + * Builds the default language object. * * @param array $options * The properties used to construct the language. diff --git a/core/lib/Drupal/Core/Language/LanguageInterface.php b/core/lib/Drupal/Core/Language/LanguageInterface.php index 2d6fac2..6c099a4 100644 --- a/core/lib/Drupal/Core/Language/LanguageInterface.php +++ b/core/lib/Drupal/Core/Language/LanguageInterface.php @@ -97,7 +97,10 @@ const DIRECTION_RTL = 1; /** - * Get the name of the Language object. + * Gets the name of the Language object. + * + * @return string + * The human readable English name of the Language. */ public function getName(); @@ -105,6 +108,7 @@ public function getName(); * Sets the name. * * @param string $name + * The human readable English name of the Language. * * @return $this */ @@ -114,13 +118,15 @@ public function setName($name); * Gets the ID (language code). * * @return string + * The langcode. */ public function getId(); /** * Sets the ID (language code). * - * @param string $langcode + * @param string $id + * The langcode. * * @return $this */ @@ -137,7 +143,8 @@ public function getDirection(); /** * Sets the direction of the language. * - * @param string $direction + * @param int $direction + * Either self::DIRECTION_LTR or self::DIRECTION_RTL. * * @return $this */ @@ -145,6 +152,10 @@ public function setDirection($direction); /** * Gets the weight of the language. + * + * @return int + * The weight, used to order languages with larger positive weights sinking + * items toward the bottom of lists. */ public function getWeight(); @@ -152,15 +163,18 @@ public function getWeight(); * Sets the weight of the language. * * @param int $weight + * The weight, used to order languages with larger positive weights sinking + * items toward the bottom of lists. * * @return $this */ public function setWeight($weight); /** - * Gets whether this language is the default language. + * Returns whether this language is the default language. * * @return bool + * Whether the language is the default language. */ public function isDefault(); @@ -168,6 +182,7 @@ public function isDefault(); * Sets whether this language is the default language. * * @param bool $default + * True if it is the default language. * * @return $this */ @@ -175,6 +190,9 @@ public function setDefault($default); /** * Gets the language negotiation method ID for this language. + * + * @return string + * The method ID, for example, LanguageNegotiatorInterface::METHOD_ID. */ public function getNegotiationMethodId(); @@ -182,8 +200,10 @@ public function getNegotiationMethodId(); * Sets the language negotiation method ID for this language. * * @param string $method_id + * The method ID, for example, LanguageNegotiatorInterface::METHOD_ID. * * @return $this */ public function setNegotiationMethodId($method_id); + } diff --git a/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php b/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php index 11635ec..466ad87 100644 --- a/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php @@ -13,6 +13,9 @@ /** * Tests \Drupal\Core\Language\Language. + * + * @group Drupal + * @group Language */ class LanguageUnitTest extends UnitTestCase { @@ -35,13 +38,15 @@ public static function getInfo() { } /** - * {@inheritdoc + * {@inheritdoc} */ public function setUp() { $this->language = new Language(); } /** + * Tests name getter and setter methods. + * * @covers \Drupal\Core\Language\Language::getName() * @covers \Drupal\Core\Language\Language::setName() */ @@ -52,6 +57,8 @@ public function testGetName() { } /** + * Tests langcode ID getter and setter methods. + * * @covers \Drupal\Core\Language\Language::getId() * @covers \Drupal\Core\Language\Language::setId() */ @@ -62,6 +69,8 @@ public function testGetLangcode() { } /** + * Tests direction getter and setter methods. + * * @covers \Drupal\Core\Language\Language::getDirection() * @covers \Drupal\Core\Language\Language::setDirection() */ @@ -72,6 +81,8 @@ public function testGetDirection() { } /** + * Tests isDefault() and default setter. + * * @covers \Drupal\Core\Language\Language::isDefault() * @covers \Drupal\Core\Language\Language::setDefault() */ @@ -82,6 +93,8 @@ public function testIsDefault() { } /** + * Tests negotiationMethodId getter and setter methods. + * * @covers \Drupal\Core\Language\Language::getNegotiationMethodId() * @covers \Drupal\Core\Language\Language::setNegotiationMethodId() */ @@ -90,4 +103,5 @@ public function testGetNegotiationMethodId() { $this->assertSame(spl_object_hash($this->language), spl_object_hash($this->language->setNegotiationMethodId($method_id))); $this->assertSame($method_id, $this->language->getNegotiationMethodId()); } + }