Skip to content

Commit 4b8b0ae

Browse files
committed
avoid returning useless null
1 parent 1159501 commit 4b8b0ae

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Twig/Extension/CountryExtension.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public function getName() {
3232
* @return string|null
3333
*/
3434
public function getCountry($key) {
35-
if (empty($key)) {
36-
return null;
37-
}
38-
39-
$choices = Locale::getDisplayCountries(\Locale::getDefault());
35+
if (!empty($key)) {
36+
$choices = Locale::getDisplayCountries(\Locale::getDefault());
4037

41-
return array_key_exists($key, $choices) ? $choices[$key] : null;
38+
if (array_key_exists($key, $choices)) {
39+
return $choices[$key];
40+
}
41+
}
4242
}
4343

4444
}

0 commit comments

Comments
 (0)