Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents 5fbee19 + 2628ded commit 295995d
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Countries.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static function numericCodeExists(string $numericCode): bool
*
* @throws MissingResourceException if the country code does not exist
*/
public static function getName(string $country, string $displayLocale = null): string
public static function getName(string $country, ?string $displayLocale = null): string
{
return self::readEntry(['Names', $country], $displayLocale);
}
Expand All @@ -137,7 +137,7 @@ public static function getName(string $country, string $displayLocale = null): s
*
* @throws MissingResourceException if the country code does not exist
*/
public static function getAlpha3Name(string $alpha3Code, string $displayLocale = null): string
public static function getAlpha3Name(string $alpha3Code, ?string $displayLocale = null): string
{
return self::getName(self::getAlpha2Code($alpha3Code), $displayLocale);
}
Expand All @@ -147,7 +147,7 @@ public static function getAlpha3Name(string $alpha3Code, string $displayLocale =
*
* @return array<string, string>
*/
public static function getNames(string $displayLocale = null): array
public static function getNames(?string $displayLocale = null): array
{
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
}
Expand All @@ -159,7 +159,7 @@ public static function getNames(string $displayLocale = null): array
*
* @return array<string, string>
*/
public static function getAlpha3Names(string $displayLocale = null): array
public static function getAlpha3Names(?string $displayLocale = null): array
{
$alpha2Names = self::getNames($displayLocale);
$alpha3Names = [];
Expand Down
6 changes: 3 additions & 3 deletions Currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ public static function exists(string $currency): bool
/**
* @throws MissingResourceException if the currency code does not exist
*/
public static function getName(string $currency, string $displayLocale = null): string
public static function getName(string $currency, ?string $displayLocale = null): string
{
return self::readEntry(['Names', $currency, self::INDEX_NAME], $displayLocale);
}

/**
* @return string[]
*/
public static function getNames(string $displayLocale = null): array
public static function getNames(?string $displayLocale = null): array
{
// ====================================================================
// For reference: It is NOT possible to return names indexed by
Expand All @@ -82,7 +82,7 @@ public static function getNames(string $displayLocale = null): array
/**
* @throws MissingResourceException if the currency code does not exist
*/
public static function getSymbol(string $currency, string $displayLocale = null): string
public static function getSymbol(string $currency, ?string $displayLocale = null): string
{
return self::readEntry(['Names', $currency, self::INDEX_SYMBOL], $displayLocale);
}
Expand Down
2 changes: 1 addition & 1 deletion Data/Generator/TimezoneDataGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function generateZones(BundleEntryReaderInterface $reader, string $tempD

$regionFormat = $reader->readEntry($tempDir, $locale, ['zoneStrings', 'regionFormat']);
$fallbackFormat = $reader->readEntry($tempDir, $locale, ['zoneStrings', 'fallbackFormat']);
$resolveName = function (string $id, string $city = null) use ($reader, $tempDir, $locale, $regionFormat, $fallbackFormat): ?string {
$resolveName = function (string $id, ?string $city = null) use ($reader, $tempDir, $locale, $regionFormat, $fallbackFormat): ?string {
// Resolve default name as described per http://cldr.unicode.org/translation/timezones
if (isset($this->zoneToCountryMapping[$id])) {
try {
Expand Down
8 changes: 4 additions & 4 deletions Languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function exists(string $language): bool
*
* @throws MissingResourceException if the language code does not exist
*/
public static function getName(string $language, string $displayLocale = null): string
public static function getName(string $language, ?string $displayLocale = null): string
{
try {
return self::readEntry(['Names', $language], $displayLocale);
Expand All @@ -78,7 +78,7 @@ public static function getName(string $language, string $displayLocale = null):
*
* @return array<string, string>
*/
public static function getNames(string $displayLocale = null): array
public static function getNames(?string $displayLocale = null): array
{
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
}
Expand Down Expand Up @@ -137,7 +137,7 @@ public static function alpha3CodeExists(string $language): bool
*
* @throws MissingResourceException if the country code does not exists
*/
public static function getAlpha3Name(string $language, string $displayLocale = null): string
public static function getAlpha3Name(string $language, ?string $displayLocale = null): string
{
try {
return self::getName(self::getAlpha2Code($language), $displayLocale);
Expand All @@ -157,7 +157,7 @@ public static function getAlpha3Name(string $language, string $displayLocale = n
*
* @return array<string, string>
*/
public static function getAlpha3Names(string $displayLocale = null): array
public static function getAlpha3Names(?string $displayLocale = null): array
{
$alpha2Names = self::getNames($displayLocale);
$alpha3Names = [];
Expand Down
4 changes: 2 additions & 2 deletions Locales.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function exists(string $locale): bool
/**
* @throws MissingResourceException if the locale does not exist
*/
public static function getName(string $locale, string $displayLocale = null): string
public static function getName(string $locale, ?string $displayLocale = null): string
{
try {
return self::readEntry(['Names', $locale], $displayLocale);
Expand All @@ -67,7 +67,7 @@ public static function getName(string $locale, string $displayLocale = null): st
/**
* @return string[]
*/
public static function getNames(string $displayLocale = null): array
public static function getNames(?string $displayLocale = null): array
{
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
}
Expand Down
4 changes: 2 additions & 2 deletions ResourceBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract protected static function getPath(): string;
* @return mixed returns an array or {@link \ArrayAccess} instance for
* complex data and a scalar value for simple data
*/
final protected static function readEntry(array $indices, string $locale = null, bool $fallback = true): mixed
final protected static function readEntry(array $indices, ?string $locale = null, bool $fallback = true): mixed
{
if (!isset(self::$entryReader)) {
self::$entryReader = new BundleEntryReader(new BufferedBundleReader(
Expand All @@ -58,7 +58,7 @@ final protected static function readEntry(array $indices, string $locale = null,
return self::$entryReader->readEntry(static::getPath(), $locale ?? \Locale::getDefault(), $indices, $fallback);
}

final protected static function asort(iterable $list, string $locale = null): array
final protected static function asort(iterable $list, ?string $locale = null): array
{
if ($list instanceof \Traversable) {
$list = iterator_to_array($list);
Expand Down
4 changes: 2 additions & 2 deletions Scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public static function exists(string $script): bool
/**
* @throws MissingResourceException if the script code does not exist
*/
public static function getName(string $script, string $displayLocale = null): string
public static function getName(string $script, ?string $displayLocale = null): string
{
return self::readEntry(['Names', $script], $displayLocale);
}

/**
* @return string[]
*/
public static function getNames(string $displayLocale = null): array
public static function getNames(?string $displayLocale = null): array
{
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
}
Expand Down
8 changes: 4 additions & 4 deletions Timezones.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ public static function exists(string $timezone): bool
/**
* @throws MissingResourceException if the timezone identifier does not exist or is an alias
*/
public static function getName(string $timezone, string $displayLocale = null): string
public static function getName(string $timezone, ?string $displayLocale = null): string
{
return self::readEntry(['Names', $timezone], $displayLocale);
}

/**
* @return string[]
*/
public static function getNames(string $displayLocale = null): array
public static function getNames(?string $displayLocale = null): array
{
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
}
Expand All @@ -66,14 +66,14 @@ public static function getNames(string $displayLocale = null): array
* @throws \Exception if the timezone identifier does not exist
* @throws RuntimeException if there's no timezone DST transition information available
*/
public static function getRawOffset(string $timezone, int $timestamp = null): int
public static function getRawOffset(string $timezone, ?int $timestamp = null): int
{
$dateTimeImmutable = new \DateTimeImmutable(date('Y-m-d H:i:s', $timestamp ?? time()), new \DateTimeZone($timezone));

return $dateTimeImmutable->getOffset();
}

public static function getGmtOffset(string $timezone, int $timestamp = null, string $displayLocale = null): string
public static function getGmtOffset(string $timezone, ?int $timestamp = null, ?string $displayLocale = null): string
{
$offset = self::getRawOffset($timezone, $timestamp);
$abs = abs($offset);
Expand Down
4 changes: 2 additions & 2 deletions Util/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getLastAuthoredDate(): \DateTimeImmutable
return new \DateTimeImmutable($this->getLastLine($this->execInPath('git log -1 --format="%ai"')));
}

public function getLastTag(callable $filter = null): string
public function getLastTag(?callable $filter = null): string
{
$tags = $this->execInPath('git tag -l --sort=v:refname');

Expand All @@ -90,7 +90,7 @@ private function execInPath(string $command): array
return self::exec(sprintf('cd %s && %s', escapeshellarg($this->path), $command));
}

private static function exec(string $command, string $customErrorMessage = null): array
private static function exec(string $command, ?string $customErrorMessage = null): array
{
exec(sprintf('%s 2>&1', $command), $output, $result);

Expand Down
2 changes: 1 addition & 1 deletion Util/IcuVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class IcuVersion
*
* @see normalize()
*/
public static function compare(string $version1, string $version2, string $operator, int $precision = null): bool
public static function compare(string $version1, string $version2, string $operator, ?int $precision = null): bool
{
$version1 = self::normalize($version1, $precision);
$version2 = self::normalize($version2, $precision);
Expand Down
4 changes: 2 additions & 2 deletions Util/IntlTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IntlTestHelper
/**
* Should be called before tests that work fine with the stub implementation.
*/
public static function requireIntl(TestCase $testCase, string $minimumIcuVersion = null): void
public static function requireIntl(TestCase $testCase, ?string $minimumIcuVersion = null): void
{
$minimumIcuVersion ??= Intl::getIcuStubVersion();

Expand Down Expand Up @@ -62,7 +62,7 @@ public static function requireIntl(TestCase $testCase, string $minimumIcuVersion
* Should be called before tests that require a feature-complete intl
* implementation.
*/
public static function requireFullIntl(TestCase $testCase, string $minimumIcuVersion = null): void
public static function requireFullIntl(TestCase $testCase, ?string $minimumIcuVersion = null): void
{
// We only run tests if the intl extension is loaded...
if (!Intl::isExtensionLoaded()) {
Expand Down
2 changes: 1 addition & 1 deletion Util/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Version
*
* @see normalize()
*/
public static function compare(string $version1, string $version2, string $operator, int $precision = null): bool
public static function compare(string $version1, string $version2, string $operator, ?int $precision = null): bool
{
$version1 = self::normalize($version1, $precision);
$version2 = self::normalize($version2, $precision);
Expand Down

0 comments on commit 295995d

Please sign in to comment.