Skip to content

Commit 2d7d406

Browse files
Backport type fixes
1 parent 1a9d799 commit 2d7d406

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

0 commit comments

Comments
 (0)