diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-03-07 18:49:27 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-03-07 21:37:35 +0000 |
| commit | e364afe4ae4e316fc4ebd53eccbaff2d29e419a5 (patch) | |
| tree | 9e269d16bd3714e9943169fc4a31c192b065c36c /app/I18N.php | |
| parent | 7d99559cb9c1475576caf7ef2fe79a5aad947d30 (diff) | |
| download | webtrees-e364afe4ae4e316fc4ebd53eccbaff2d29e419a5.tar.gz webtrees-e364afe4ae4e316fc4ebd53eccbaff2d29e419a5.tar.bz2 webtrees-e364afe4ae4e316fc4ebd53eccbaff2d29e419a5.zip | |
Code style and testing
Diffstat (limited to 'app/I18N.php')
| -rw-r--r-- | app/I18N.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/I18N.php b/app/I18N.php index c557966a9f..888df923e3 100644 --- a/app/I18N.php +++ b/app/I18N.php @@ -260,7 +260,7 @@ class I18N * * @return string */ - public static function collation() + public static function collation(): string { $collation = self::$locale->collation(); switch ($collation) { @@ -588,7 +588,7 @@ class I18N $reversed = ''; $digits = ''; - while ($text != '') { + while ($text !== '') { $letter = mb_substr($text, 0, 1); $text = mb_substr($text, 1); if (strpos(self::DIGITS, $letter) !== false) { @@ -611,7 +611,7 @@ class I18N * * @return string */ - public static function scriptDirection($script) + public static function scriptDirection($script): string { switch ($script) { case 'Arab': @@ -632,13 +632,13 @@ class I18N * * @return int */ - public static function strcasecmp($string1, $string2) + public static function strcasecmp($string1, $string2): int { if (self::$collator instanceof Collator) { return self::$collator->compare($string1, $string2); - } else { - return strcmp(self::strtolower($string1), self::strtolower($string2)); } + + return strcmp(self::strtolower($string1), self::strtolower($string2)); } /** @@ -732,7 +732,7 @@ class I18N * * @return string */ - public static function timeAgo($seconds) + public static function timeAgo($seconds): string { $minute = 60; $hour = 60 * $minute; |
