diff --git a/lib/SimpleSAML/Locale/Language.php b/lib/SimpleSAML/Locale/Language.php index 94a1c0bf42b82c26d347d2aff62d0c7c0edbe994..e8f06cf09875a05bfee64a5779acd3a4e5c4792b 100644 --- a/lib/SimpleSAML/Locale/Language.php +++ b/lib/SimpleSAML/Locale/Language.php @@ -196,6 +196,7 @@ class Language * * @param string $language Language code for the language to set. * @param boolean $setLanguageCookie Whether to set the language cookie or not. Defaults to true. + * @return void */ public function setLanguage($language, $setLanguageCookie = true) { @@ -255,7 +256,7 @@ class Language * * @param string $code The ISO 639-2 code of the language. * - * @return string The localized name of the language. + * @return string|null The localized name of the language. */ public function getLanguageLocalizedName($code) { @@ -281,8 +282,8 @@ class Language /** * This method returns the preferred language for the user based on the Accept-Language HTTP header. * - * @return string The preferred language based on the Accept-Language HTTP header, or null if none of the languages - * in the header is available. + * @return string|null The preferred language based on the Accept-Language HTTP header, + * or null if none of the languages in the header is available. */ private function getHTTPLanguage() { @@ -334,7 +335,8 @@ class Language /** * Return an alias for a language code, if any. * - * @return string The alias, or null if the alias was not found. + * @param string $langcode + * @return string|null The alias, or null if the alias was not found. */ public function getLanguageCodeAlias($langcode) { @@ -399,6 +401,7 @@ class Language * specified is not in the list of available languages, or the headers have already been sent to the browser. * * @param string $language The language set by the user. + * @return void */ public static function setLanguageCookie($language) { diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php index 822a71f96f80d59c5376215c65598137a04a9d9e..c9c7e93a2f4f64fe339cc98bac239843e8954649 100644 --- a/lib/SimpleSAML/Locale/Localization.php +++ b/lib/SimpleSAML/Locale/Localization.php @@ -132,6 +132,7 @@ class Localization * * @param string $module Module name * @param string $localeDir Absolute path if the module is housed elsewhere + * @return void */ public function addModuleDomain($module, $localeDir = null) { @@ -148,6 +149,7 @@ class Localization * * @param string $localeDir Location of translations * @param string $domain Domain at location + * @return void */ public function addDomain($localeDir, $domain) { @@ -156,7 +158,7 @@ class Localization $this->loadGettextGettextFromPO($domain); } - /* + /** * Get and check path of localization file * * @param string $domain Name of localization domain @@ -205,6 +207,7 @@ class Localization /** * Setup the translator + * @return void */ private function setupTranslator() { @@ -221,6 +224,7 @@ class Localization * * @param string $domain Name of domain * @param boolean $catchException Whether to catch an exception on error or return early + * @return void * * @throws \Exception If something is wrong with the locale file for the domain and activated language */ @@ -268,6 +272,7 @@ class Localization /** * Set up L18N if configured or fallback to old system + * @return void */ private function setupL10N() { diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php index d64f222cd78715346fc40a626a7237ff3aa907ce..a5c0442ad2b23228b48dd00d4db5c80c1cb1aa07 100644 --- a/lib/SimpleSAML/Locale/Translate.php +++ b/lib/SimpleSAML/Locale/Translate.php @@ -119,7 +119,7 @@ class Translate * @param string $tag The tag name. The tag name can also be on the form '{<dictionary>:<tag>}', to retrieve a tag * from the specific dictionary. * - * @return array An associative array with language => string mappings, or null if the tag wasn't found. + * @return array|null An associative array with language => string mappings, or null if the tag wasn't found. */ public function getTag($tag) { @@ -252,6 +252,8 @@ class Translate * @param array $replacements An associative array of keys that should be replaced with values in the * translated string. * @param boolean $fallbackdefault Default translation to use as a fallback if no valid translation was found. + * @param array $oldreplacements + * @param bool $striptags * @deprecated Not used in twig, gettext * * @return string The translated tag, or a placeholder value if the tag wasn't found. @@ -285,7 +287,7 @@ class Translate ); // for backwards compatibility - if (!$replacements && $this->getTag($tag) === null) { + if (!$replacements && ($this->getTag($tag) === null)) { \SimpleSAML\Logger::warning( 'Code which uses $fallbackdefault === FALSE should be updated to use the getTag() method instead.' ); @@ -349,6 +351,7 @@ class Translate * @param array|string $translation The translation array * * @throws \Exception If $translation is neither a string nor an array. + * @return void */ public function includeInlineTranslation($tag, $translation) { @@ -370,6 +373,7 @@ class Translate * one provided in the constructor to be used to find the directory of the dictionary. This allows to combine * dictionaries inside the SimpleSAMLphp main code distribution together with external dictionaries. Defaults to * null. + * @return void */ public function includeLanguageFile($file, $otherConfig = null) {