original_string: private function getLanguage(array $languageCodes, $mainLanguageCode, $alwaysAvailable)
      {
          $languageCodesSet = array_flip($languageCodes);
  
          foreach ($this->settings->prioritizedLanguages as $languageCode) {
              if (isset($languageCodesSet[$languageCode])) {
                  return $languageCode;
              }
          }
  
          if ($this->settings->useAlwaysAvailable && $alwaysAvailable) {
              return $mainLanguageCode;
          }
  
          return null;
      }
code: private function getLanguage(array $languageCodes, $mainLanguageCode, $alwaysAvailable)
      {
          $languageCodesSet = array_flip($languageCodes);
  
          foreach ($this->settings->prioritizedLanguages as $languageCode) {
              if (isset($languageCodesSet[$languageCode])) {
                  return $languageCode;
              }
          }
  
          if ($this->settings->useAlwaysAvailable && $alwaysAvailable) {
              return $mainLanguageCode;
          }
  
          return null;
      }
code_tokens: private function getLanguage ( array $ languageCodes , $ mainLanguageCode , $ alwaysAvailable ) { $ languageCodesSet = array_flip ( $ languageCodes ) ; foreach ( $ this -> settings -> prioritizedLanguages as $ languageCode ) { if ( isset ( $ languageCodesSet [ $ languageCode ] ) ) { return $ languageCode ; } } if ( $ this -> settings -> useAlwaysAvailable && $ alwaysAvailable ) { return $ mainLanguageCode ; } return null ; }
docstring: Returns the most prioritized language for the given parameters.
  
  Will return null if language could not be resolved.
  
  @param string[] $languageCodes
  @param string $mainLanguageCode
  @param bool $alwaysAvailable
  
  @return string|null
docstring_tokens: Returns the most prioritized language for the given parameters .