src/LanguageFactory.php
public function create($languageCode) {
    $mappings = $this->getMappings();

    if (!isset($mappings[$languageCode])) {
      throw new \InvalidArgumentException('The language code is not part of the supported list. Please see GoogleSupportedLanguages\LanguageFactory::getMappings() for reference.');
    }

    return new $mappings[$languageCode]();
  }
public function create($languageCode) {
    $mappings = $this->getMappings();

    if (!isset($mappings[$languageCode])) {
      throw new \InvalidArgumentException('The language code is not part of the supported list. Please see GoogleSupportedLanguages\LanguageFactory::getMappings() for reference.');
    }

    return new $mappings[$languageCode]();
  }
public function create ( $ languageCode ) { $ mappings = $ this -> getMappings ( ) ; if ( ! isset ( $ mappings [ $ languageCode ] ) ) { throw new \ InvalidArgumentException ( 'The language code is not part of the supported list. Please see GoogleSupportedLanguages\LanguageFactory::getMappings() for reference.' ) ; } return new $ mappings [ $ languageCode ] ( ) ; }
Create a language object from the language code.

@param string $languageCode
@return LanguageInterface
Create a language object from the language code .