Skip to content

Commit 652592a

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents e85d394 + 40fcbb1 commit 652592a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Helpers/L10nHelper.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class L10nHelper
1111
* Get the available locale codes from the configuration.
1212
*
1313
* @return string[]
14+
*
1415
* @throws InvalidConfigurationException
1516
*/
1617
public static function getAvailableLocales(): array
@@ -38,6 +39,7 @@ public static function getAvailableLocales(): array
3839
* Returns an array of locale codes (as keys) and their corresponding names (as values).
3940
*
4041
* @return string[]
42+
*
4143
* @throws InvalidConfigurationException
4244
*/
4345
public static function getLocaleOptions(): array
@@ -50,8 +52,8 @@ public static function getLocaleOptions(): array
5052
* 1. If the `intl` PHP extension is installed, use the `\Locale` class to get the language name.
5153
* 2. Otherwise, return the language code
5254
*
53-
* @param string $code Language code
54-
* @param bool $include_code Include the language code in the output (in parentheses)
55+
* @param string $code Language code
56+
* @param bool $include_code Include the language code in the output (in parentheses)
5557
* @return string Language name
5658
*/
5759
public static function getLanguageName(string $code, bool $include_code = false): string
@@ -65,7 +67,7 @@ public static function getLanguageName(string $code, bool $include_code = false)
6567
$name = Locale::getDisplayLanguage($code, config('app.locale'));
6668

6769
if (is_string($name) && ! empty($name)) {
68-
return $name . ($include_code ? ' (' . $code . ')' : '');
70+
return $name.($include_code ? ' ('.$code.')' : '');
6971
}
7072

7173
return $code;

tests/CommonPluginTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
use Eclipse\Common\CommonPlugin;
43
use Eclipse\Common\Admin\Filament\Clusters\Settings;
4+
use Eclipse\Common\CommonPlugin;
55

66
it('can get and set settings cluster', function () {
7-
$plugin = new CommonPlugin();
7+
$plugin = new CommonPlugin;
88

99
expect($plugin->getSettingsCluster())->toBe(Settings::class);
1010

tests/Unit/Helpers/L10nHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
use Eclipse\Common\Helpers\L10nHelper as Helper;
43
use Eclipse\Common\Exceptions\InvalidConfigurationException;
4+
use Eclipse\Common\Helpers\L10nHelper as Helper;
55
use Illuminate\Support\Facades\Config;
66

77
test('it returns empty string for empty language code', function () {

0 commit comments

Comments
 (0)