13
13
14
14
define ('LINE ' , str_repeat ('- ' , LINE_WIDTH )."\n" );
15
15
16
- function bailout ($ message )
16
+ function bailout (string $ message )
17
17
{
18
18
echo wordwrap ($ message , LINE_WIDTH )." Aborting. \n" ;
19
19
20
20
exit (1 );
21
21
}
22
22
23
- function strip_minor_versions ($ version )
23
+ function strip_minor_versions (string $ version )
24
24
{
25
25
preg_match ('/^(?P<version>[0-9]\.[0-9]|[0-9]{2,})/ ' , $ version , $ matches );
26
26
27
27
return $ matches ['version ' ];
28
28
}
29
29
30
- function centered ($ text )
30
+ function centered (string $ text )
31
31
{
32
32
$ padding = (int ) ((LINE_WIDTH - strlen ($ text )) / 2 );
33
33
34
34
return str_repeat (' ' , $ padding ).$ text ;
35
35
}
36
36
37
- function cd ($ dir )
37
+ function cd (string $ dir )
38
38
{
39
39
if (false === chdir ($ dir )) {
40
40
bailout ("Could not switch to directory $ dir. " );
41
41
}
42
42
}
43
43
44
- function run ($ command )
44
+ function run (string $ command )
45
45
{
46
46
exec ($ command , $ output , $ status );
47
47
@@ -53,7 +53,7 @@ function run($command)
53
53
}
54
54
}
55
55
56
- function get_icu_version_from_genrb ($ genrb )
56
+ function get_icu_version_from_genrb (string $ genrb )
57
57
{
58
58
exec ($ genrb .' --version - 2>&1 ' , $ output , $ status );
59
59
@@ -70,7 +70,7 @@ function get_icu_version_from_genrb($genrb)
70
70
71
71
error_reporting (\E_ALL );
72
72
73
- set_error_handler (function ($ type , $ msg , $ file , $ line ) {
73
+ set_error_handler (function (int $ type , string $ msg , string $ file , int $ line ) {
74
74
throw new \ErrorException ($ msg , 0 , $ type , $ file , $ line );
75
75
});
76
76
0 commit comments