Commit cc7ca3ed authored by catch's avatar catch

Issue #2020301 by plach, Berdir: Make the $type parameter of...

Issue #2020301 by plach, Berdir: Make the $type parameter of LanguageManager::getLanguage() optional.
parent b44d95bf
......@@ -76,12 +76,13 @@ public function setRequest(Request $request) {
* Returns a language object for the given type.
*
* @param string $type
* The language type, e.g. Language::TYPE_INTERFACE.
* (optional) The language type, e.g. the interface or the content language.
* Defaults to \Drupal\Core\Language\Language::TYPE_INTERFACE.
*
* @return \Drupal\Core\Language\Language
* A language object for the given type.
*/
public function getLanguage($type) {
public function getLanguage($type = Language::TYPE_INTERFACE) {
if (isset($this->languages[$type])) {
return $this->languages[$type];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment