Skip to content

Commit 1b9eee9

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent 2cf01a5 commit 1b9eee9

File tree

8 files changed

+17
-7
lines changed

8 files changed

+17
-7
lines changed

Data/Generator/CurrencyDataGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
9090

9191
return $data;
9292
}
93+
94+
return null;
9395
}
9496

9597
/**

Data/Generator/LanguageDataGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
134134

135135
return $data;
136136
}
137+
138+
return null;
137139
}
138140

139141
/**

Data/Generator/RegionDataGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
104104

105105
return $data;
106106
}
107+
108+
return null;
107109
}
108110

109111
/**

Data/Generator/ScriptDataGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
7373

7474
return $data;
7575
}
76+
77+
return null;
7678
}
7779

7880
/**

DateFormatter/DateFormat/FullTransformer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function format(\DateTime $dateTime)
101101
* @param string $dateChars The date characters to be replaced with a formatted ICU value
102102
* @param \DateTime $dateTime A DateTime object to be used to generate the formatted value
103103
*
104-
* @return string The formatted value
104+
* @return string|null The formatted value
105105
*
106106
* @throws NotImplementedException When it encounters a not implemented date character
107107
*/
@@ -123,6 +123,8 @@ public function formatReplace($dateChars, $dateTime)
123123
if (false !== strpos($this->notImplementedChars, $dateChars[0])) {
124124
throw new NotImplementedException(sprintf('Unimplemented date character "%s" in format "%s"', $dateChars[0], $this->pattern));
125125
}
126+
127+
return null;
126128
}
127129

128130
/**
@@ -196,6 +198,8 @@ public function getReverseMatchingRegExp($pattern)
196198

197199
return "(?P<$captureName>".$transformer->getReverseMatchingRegExp($length).')';
198200
}
201+
202+
return null;
199203
}, $escapedPattern);
200204

201205
return $reverseMatchingRegExp;

Locale.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ public static function getFallback($locale)
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-
}
107+
return \strlen($locale) < 4 ? self::$defaultFallback : null;
110108
}
111109

112110
/**

ResourceBundle/CurrencyBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getFractionDigits($currency)
8383
try {
8484
return parent::getFractionDigits($currency);
8585
} catch (MissingResourceException $e) {
86-
return;
86+
return null;
8787
}
8888
}
8989

@@ -95,7 +95,7 @@ public function getRoundingIncrement($currency)
9595
try {
9696
return parent::getRoundingIncrement($currency);
9797
} catch (MissingResourceException $e) {
98-
return;
98+
return null;
9999
}
100100
}
101101

Resources/bin/common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function get_icu_version_from_genrb($genrb)
6262
}
6363

6464
if (!preg_match('/ICU version ([\d\.]+)/', implode('', $output), $matches)) {
65-
return;
65+
return null;
6666
}
6767

6868
return $matches[1];

0 commit comments

Comments
 (0)