8000 revert "avoid returning useless `null`" · craue/CraueFormFlowDemoBundle@334e1fc · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 334e1fc

Browse files
committed
revert "avoid returning useless null"
this reverts commit 4b8b0ae due to symfony/symfony-docs#6614
1 parent 88031bc commit 334e1fc

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Twig/Extension/CountryExtension.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,20 @@ public function getName() {
4040
* @return string|null
4141
*/
4242
public function getCountry($key) {
43-
if (!empty($key)) {
44-
$locale = \Locale::getDefault();
45-
46-
if (Kernel::VERSION_ID < 20300) {
47-
$choices = Locale::getDisplayCountries($locale);
48-
} else {
49-
$choices = Intl::getRegionBundle()->getCountryNames($locale);
50-
}
51-
52-
if (array_key_exists($key, $choices)) {
53-
return $choices[$key];
54-
}
43+
if (empty($key)) {
44+
return null;
45+
}
46+
47+
$locale = \Locale::getDefault();
48+
49+
if (Kernel::VERSION_ID < 20300) {
50+
$choices = Locale::getDisplayCountries($locale);
51+
} else {
52+
$choices = Intl::getRegionBundle()->getCountryNames($locale);
53+
}
54+
55+
if (array_key_exists($key, $choices)) {
56+
return $choices[$key];
5557
}
5658
}
5759

0 commit comments

Comments
 (0)
0