Skip to content

Commit 2fb503f

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent cd6cce1 commit 2fb503f

23 files changed

+50
-50
lines changed

Countries.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function alpha3CodeExists(string $alpha3Code): bool
8989
*
9090
* @throws MissingResourceException if the country code does not exist
9191
*/
92-
public static function getName(string $country, string $displayLocale = null): string
92+
public static function getName(string $country, ?string $displayLocale = null): string
9393
{
9494
return self::readEntry(['Names', $country], $displayLocale);
9595
}
@@ -99,7 +99,7 @@ public static function getName(string $country, string $displayLocale = null): s
9999
*
100100
* @throws MissingResourceException if the country code does not exist
101101
*/
102-
public static function getAlpha3Name(string $alpha3Code, string $displayLocale = null): string
102+
public static function getAlpha3Name(string $alpha3Code, ?string $displayLocale = null): string
103103
{
104104
return self::getName(self::getAlpha2Code($alpha3Code), $displayLocale);
105105
}
@@ -109,7 +109,7 @@ public static function getAlpha3Name(string $alpha3Code, string $displayLocale =
109109
*
110110
* @return array<string, string>
111111
*/
112-
public static function getNames(string $displayLocale = null): array
112+
public static function getNames(?string $displayLocale = null): array
113113
{
114114
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
115115
}
@@ -121,7 +121,7 @@ public static function getNames(string $displayLocale = null): array
121121
*
122122
* @return array<string, string>
123123
*/
124-
public static function getAlpha3Names(string $displayLocale = null): array
124+
public static function getAlpha3Names(?string $displayLocale = null): array
125125
{
126126
$alpha2Names = self::getNames($displayLocale);
127127
$alpha3Names = [];

Currencies.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public static function exists(string $currency): bool
5050
/**
5151
* @throws MissingResourceException if the currency code does not exist
5252
*/
53-
public static function getName(string $currency, string $displayLocale = null): string
53+
public static function getName(string $currency, ?string $displayLocale = null): string
5454
{
5555
return self::readEntry(['Names', $currency, self::INDEX_NAME], $displayLocale);
5656
}
5757

5858
/**
5959
* @return string[]
6060
*/
61-
public static function getNames(string $displayLocale = null): array
61+
public static function getNames(?string $displayLocale = null): array
6262
{
6363
// ====================================================================
6464
// For reference: It is NOT possible to return names indexed by
@@ -82,7 +82,7 @@ public static function getNames(string $displayLocale = null): array
8282
/**
8383
* @throws MissingResourceException if the currency code does not exist
8484
*/
85-
public static function getSymbol(string $currency, string $displayLocale = null): string
85+
public static function getSymbol(string $currency, ?string $displayLocale = null): string
8686
{
8787
return self::readEntry(['Names', $currency, self::INDEX_SYMBOL], $displayLocale);
8888
}

Data/Generator/TimezoneDataGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private function generateZones(BundleEntryReaderInterface $reader, string $tempD
177177

178178
$regionFormat = $reader->readEntry($tempDir, $locale, ['zoneStrings', 'regionFormat']);
179179
$fallbackFormat = $reader->readEntry($tempDir, $locale, ['zoneStrings', 'fallbackFormat']);
180-
$resolveName = function (string $id, string $city = null) use ($reader, $tempDir, $locale, $regionFormat, $fallbackFormat): ?string {
180+
$resolveName = function (string $id, ?string $city = null) use ($reader, $tempDir, $locale, $regionFormat, $fallbackFormat): ?string {
181181
// Resolve default name as described per http://cldr.unicode.org/translation/timezones
182182
if (isset($this->zoneToCountryMapping[$id])) {
183183
try {

DateFormatter/DateFormat/Hour1200Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function format(\DateTime $dateTime, int $length): string
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
public function normalizeHour(int $hour, string $marker = null): int
39+
public function normalizeHour(int $hour, ?string $marker = null): int
4040
{
4141
if ('PM' === $marker) {
4242
$hour += 12;

DateFormatter/DateFormat/Hour1201Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function format(\DateTime $dateTime, int $length): string
3333
/**
3434
* {@inheritdoc}
3535
*/
36-
public function normalizeHour(int $hour, string $marker = null): int
36+
public function normalizeHour(int $hour, ?string $marker = null): int
3737
{
3838
if ('PM' !== $marker && 12 === $hour) {
3939
$hour = 0;

DateFormatter/DateFormat/Hour2400Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function format(\DateTime $dateTime, int $length): string
3333
/**
3434
* {@inheritdoc}
3535
*/
36-
public function normalizeHour(int $hour, string $marker = null): int
36+
public function normalizeHour(int $hour, ?string $marker = null): int
3737
{
3838
if ('AM' === $marker) {
3939
$hour = 0;

DateFormatter/DateFormat/Hour2401Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function format(\DateTime $dateTime, int $length): string
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
public function normalizeHour(int $hour, string $marker = null): int
39+
public function normalizeHour(int $hour, ?string $marker = null): int
4040
{
4141
if ((null === $marker && 24 === $hour) || 'AM' === $marker) {
4242
$hour = 0;

DateFormatter/DateFormat/HourTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ abstract class HourTransformer extends Transformer
3030
*
3131
* @return int The normalized hour value
3232
*/
33-
abstract public function normalizeHour(int $hour, string $marker = null): int;
33+
abstract public function normalizeHour(int $hour, ?string $marker = null): int;
3434
}

DateFormatter/IntlDateFormatter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ abstract class IntlDateFormatter
134134
* @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed
135135
* @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed
136136
*/
137-
public function __construct(?string $locale, ?int $datetype, ?int $timetype, $timezone = null, ?int $calendar = self::GREGORIAN, string $pattern = null)
137+
public function __construct(?string $locale, ?int $datetype, ?int $timetype, $timezone = null, ?int $calendar = self::GREGORIAN, ?string $pattern = null)
138138
{
139139
if ('en' !== $locale && null !== $locale) {
140140
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'locale', $locale, 'Only the locale "en" is supported');
@@ -174,7 +174,7 @@ public function __construct(?string $locale, ?int $datetype, ?int $timetype, $ti
174174
* @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed
175175
* @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed
176176
*/
177-
public static function create(?string $locale, ?int $datetype, ?int $timetype, $timezone = null, int $calendar = self::GREGORIAN, string $pattern = null)
177+
public static function create(?string $locale, ?int $datetype, ?int $timetype, $timezone = null, int $calendar = self::GREGORIAN, ?string $pattern = null)
178178
{
179179
return new static($locale, $datetype, $timetype, $timezone, $calendar, $pattern);
180180
}
@@ -244,7 +244,7 @@ public function format($timestamp)
244244
*
245245
* @throws MethodNotImplementedException
246246
*/
247-
public static function formatObject(object $object, $format = null, string $locale = null)
247+
public static function formatObject(object $object, $format = null, ?string $locale = null)
248248
{
249249
throw new MethodNotImplementedException(__METHOD__);
250250
}
@@ -430,7 +430,7 @@ public function localtime(string $value, int &$position = 0)
430430
*
431431
* @throws MethodArgumentNotImplementedException When $position different than null, behavior not implemented
432432
*/
433-
public function parse(string $value, int &$position = null)
433+
public function parse(string $value, ?int &$position = null)
434434
{
435435
// We don't calculate the position when parsing the value
436436
if (null !== $position) {

Languages.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static function exists(string $language): bool
5656
*
5757
* @throws MissingResourceException if the language code does not exist
5858
*/
59-
public static function getName(string $language, string $displayLocale = null): string
59+
public static function getName(string $language, ?string $displayLocale = null): string
6060
{
6161
try {
6262
return self::readEntry(['Names', $language], $displayLocale);
@@ -78,7 +78,7 @@ public static function getName(string $language, string $displayLocale = null):
7878
*
7979
* @return array<string, string>
8080
*/
81-
public static function getNames(string $displayLocale = null): array
81+
public static function getNames(?string $displayLocale = null): array
8282
{
8383
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
8484
}
@@ -139,7 +139,7 @@ public static function alpha3CodeExists(string $language): bool
139139
*
140140
* @throws MissingResourceException if the country code does not exists
141141
*/
142-
public static function getAlpha3Name(string $language, string $displayLocale = null): string
142+
public static function getAlpha3Name(string $language, ?string $displayLocale = null): string
143143
{
144144
try {
145145
return self::getName(self::getAlpha2Code($language), $displayLocale);
@@ -159,7 +159,7 @@ public static function getAlpha3Name(string $language, string $displayLocale = n
159159
*
160160
* @return array<string, string>
161161
*/
162-
public static function getAlpha3Names(string $displayLocale = null): array
162+
public static function getAlpha3Names(?string $displayLocale = null): array
163163
{
164164
$alpha2Names = self::getNames($displayLocale);
165165
$alpha3Names = [];

0 commit comments

Comments
 (0)