Skip to content

Commit 780b319

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent 11ceaf8 commit 780b319

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Data/Generator/TimezoneDataGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
8484
// Don't generate aliases, as they are resolved during runtime
8585
// Unless an alias is needed as fallback for de-duplication purposes
8686
if (isset($this->localeAliases[$displayLocale]) && !$this->generatingFallback) {
87-
return;
87+
return null;
8888
}
8989

9090
$localeBundle = $reader->read($tempDir, $displayLocale);
9191

9292
if (!isset($localeBundle['zoneStrings']) || null === $localeBundle['zoneStrings']) {
93-
return;
93+
return null;
9494
}
9595

9696
$data = [
@@ -115,7 +115,7 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
115115
$data['Meta'] = array_diff($data['Meta'], $fallback['Meta']);
116116
}
117117
if (!$data['Names'] && !$data['Meta']) {
118-
return;
118+
return null;
119119
}
120120

121121
$this->zoneIds = array_merge($this->zoneIds, array_keys($data['Names']));

Locale.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ public static function getFallback($locale): ?string
104104

105105
// Don't return default fallback for "root", "meta" or others
106106
// Normal locales have two or three letters
107-
if (\strlen($locale) < 4) {
108-
return self::$defaultFallback;
109-
}
110-
111-
return null;
107+
return \strlen($locale) < 4 ? self::$defaultFallback : null;
112108
}
113109

114110
/**

0 commit comments

Comments
 (0)