patch: fixes missing null check
This commit is contained in:
@@ -38,7 +38,7 @@ class CountryLanguages
|
||||
'Filipino'
|
||||
];
|
||||
|
||||
public static function fromCountryCode(string $countryCode): string
|
||||
public static function fromCountryCode(string $countryCode): ?string
|
||||
{
|
||||
$countryLanguages = [
|
||||
'US' => 'English (US)',
|
||||
@@ -85,10 +85,10 @@ class CountryLanguages
|
||||
'KE' => 'English', // Also Swahili
|
||||
];
|
||||
|
||||
return $countryLanguages[$countryCode];
|
||||
return $countryLanguages[$countryCode] ?? null;
|
||||
}
|
||||
|
||||
public static function fromCountryName(string $countryName): string
|
||||
public static function fromCountryName(string $countryName): ?string
|
||||
{
|
||||
$countryLanguages = [
|
||||
'United States' => 'English (US)',
|
||||
@@ -135,6 +135,6 @@ class CountryLanguages
|
||||
'Kenya' => 'English', // Also Swahili
|
||||
];
|
||||
|
||||
return $countryLanguages[$countryName];
|
||||
return $countryLanguages[$countryName] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user