Skip to content

Commit 96f83e4

Browse files
committed
Small tweaks to php scripts
2 parents 233cbb5 + c7d1c14 commit 96f83e4

File tree

2 files changed

+128
-128
lines changed

2 files changed

+128
-128
lines changed

run-tests.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
error_reporting(E_ALL);
9191

92-
$environment = isset($_ENV) ? $_ENV : array();
92+
$environment = $_ENV ?? array();
9393
// Note: php.ini-development sets variables_order="GPCS" not "EGPCS", in which case $_ENV is NOT populated.
9494
// detect and handle this case, or die or warn
9595
if (empty($environment)) {
@@ -1028,7 +1028,7 @@ function mail_qa_team($data, $status = false)
10281028
{
10291029
$url_bits = parse_url(QA_SUBMISSION_PAGE);
10301030

1031-
if (($proxy = getenv('http_proxy'))) {
1031+
if ($proxy = getenv('http_proxy')) {
10321032
$proxy = parse_url($proxy);
10331033
$path = $url_bits['host'].$url_bits['path'];
10341034
$host = $proxy['host'];
@@ -1148,7 +1148,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS
11481148
unset($pipes[0]);
11491149
}
11501150

1151-
$timeout = $valgrind ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60);
1151+
$timeout = $valgrind ? 300 : ($env['TEST_TIMEOUT'] ?? 60);
11521152

11531153
while (true) {
11541154
/* hide errors from interrupted syscalls */
@@ -1934,7 +1934,7 @@ function run_test($php, $file, $env)
19341934
$hrtime = hrtime();
19351935
$startTime = $hrtime[0]*1000000000 + $hrtime[1];
19361936

1937-
$out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null, $captureStdIn, $captureStdOut, $captureStdErr);
1937+
$out = system_with_timeout($cmd, $env, $section_text['STDIN'] ?? null, $captureStdIn, $captureStdOut, $captureStdErr);
19381938

19391939
junit_finish_timer($shortname);
19401940
$hrtime = hrtime();
@@ -2215,7 +2215,7 @@ function run_test($php, $file, $env)
22152215
error_report($file, $log_filename, $tested);
22162216
}
22172217
}
2218-
2218+
22192219
if ($valgrind && $leaked && $cfg["show"]["mem"]) {
22202220
show_file_block('mem', file_get_contents($memcheck_filename));
22212221
}
@@ -2823,7 +2823,7 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
28232823

28242824
junit_suite_record($suite, 'test_total');
28252825

2826-
$time = null !== $time ? $time : junit_get_timer($file_name);
2826+
$time = $time ?? junit_get_timer($file_name);
28272827
junit_suite_record($suite, 'execution_time', $time);
28282828

28292829
$escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8');

0 commit comments

Comments
 (0)