Skip to content

Commit 474f614

Browse files
Merge branch '5.2' into 5.3
* 5.2: Backport type fixes Fix CS Avoid triggering the autoloader in Deprecation::isLegacy() fix markdown markup Backport type fixes uzb translation [DependencyInjection] Fix doc blocks [DependencyInjection] Turn $defaultDeprecationTemplate into a constant [Form] better form doc types to support static analysis
2 parents 5151b64 + 8f714f3 commit 474f614

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

Countries.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static function getAlpha3Name(string $alpha3Code, string $displayLocale =
109109
*
110110
* @return string[]
111111
*/
112-
public static function getNames($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($displayLocale = null): array
121121
*
122122
* @return string[]
123123
*/
124-
public static function getAlpha3Names($displayLocale = null): array
124+
public static function getAlpha3Names(?string $displayLocale = null): array
125125
{
126126
$alpha2Names = self::getNames($displayLocale);
127127
$alpha3Names = [];

Languages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public static function getAlpha3Name(string $language, string $displayLocale = n
159159
*
160160
* @return string[]
161161
*/
162-
public static function getAlpha3Names($displayLocale = null): array
162+
public static function getAlpha3Names(string $displayLocale = null): array
163163
{
164164
$alpha2Names = self::getNames($displayLocale);
165165
$alpha3Names = [];

Locales.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function getName(string $locale, string $displayLocale = null): st
6767
/**
6868
* @return string[]
6969
*/
70-
public static function getNames($displayLocale = null): array
70+
public static function getNames(string $displayLocale = null): array
7171
{
7272
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
7373
}

Resources/bin/common.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,35 @@
1313

1414
define('LINE', str_repeat('-', LINE_WIDTH)."\n");
1515

16-
function bailout($message)
16+
function bailout(string $message)
1717
{
1818
echo wordwrap($message, LINE_WIDTH)." Aborting.\n";
1919

2020
exit(1);
2121
}
2222

23-
function strip_minor_versions($version)
23+
function strip_minor_versions(string $version)
2424
{
2525
preg_match('/^(?P<version>[0-9]\.[0-9]|[0-9]{2,})/', $version, $matches);
2626

2727
return $matches['version'];
2828
}
2929

30-
function centered($text)
30+
function centered(string $text)
3131
{
3232
$padding = (int) ((LINE_WIDTH - strlen($text)) / 2);
3333

3434
return str_repeat(' ', $padding).$text;
3535
}
3636

37-
function cd($dir)
37+
function cd(string $dir)
3838
{
3939
if (false === chdir($dir)) {
4040
bailout("Could not switch to directory $dir.");
4141
}
4242
}
4343

44-
function run($command)
44+
function run(string $command)
4545
{
4646
exec($command, $output, $status);
4747

@@ -53,7 +53,7 @@ function run($command)
5353
}
5454
}
5555

56-
function get_icu_version_from_genrb($genrb)
56+
function get_icu_version_from_genrb(string $genrb)
5757
{
5858
exec($genrb.' --version - 2>&1', $output, $status);
5959

@@ -70,7 +70,7 @@ function get_icu_version_from_genrb($genrb)
7070

7171
error_reporting(\E_ALL);
7272

73-
set_error_handler(function ($type, $msg, $file, $line) {
73+
set_error_handler(function (int $type, string $msg, string $file, int $line) {
7474
throw new \ErrorException($msg, 0, $type, $file, $line);
7575
});
7676

Scripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function getName(string $script, string $displayLocale = null): st
5151
/**
5252
* @return string[]
5353
*/
54-
public static function getNames($displayLocale = null): array
54+
public static function getNames(string $displayLocale = null): array
5555
{
5656
return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
5757
}

Util/IntlTestHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class IntlTestHelper
3030
/**
3131
* Should be called before tests that work fine with the stub implementation.
3232
*/
33-
public static function requireIntl(TestCase $testCase, $minimumIcuVersion = null)
33+
public static function requireIntl(TestCase $testCase, string $minimumIcuVersion = null)
3434
{
3535
if (null === $minimumIcuVersion) {
3636
$minimumIcuVersion = Intl::getIcuStubVersion();
@@ -64,7 +64,7 @@ public static function requireIntl(TestCase $testCase, $minimumIcuVersion = null
6464
* Should be called before tests that require a feature-complete intl
6565
* implementation.
6666
*/
67-
public static function requireFullIntl(TestCase $testCase, $minimumIcuVersion = null)
67+
public static function requireFullIntl(TestCase $testCase, string $minimumIcuVersion = null)
6868
{
6969
// We only run tests if the intl extension is loaded...
7070
if (!Intl::isExtensionLoaded()) {

0 commit comments

Comments
 (0)