Skip to content

Commit 06b009c

Browse files
Declare missing types and other minor improvements in run-tests.php (#12573)
* refactor: declare missing types and other minor improvements. * refactor: declare missing types and other minor improvements. * refactor: declare missing types and other minor improvements. * refactor: declare missing types and other minor improvements. --------- Co-authored-by: Marcos Marcolin <[email protected]>
1 parent 60a33af commit 06b009c

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

run-tests.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
/* Temporary variables while this file is being refactored. */
27-
/** @var ?JUnit */
27+
/** @var ?JUnit $junit */
2828
$junit = null;
2929

3030
/* End temporary variables. */
@@ -166,7 +166,7 @@ function main(): void
166166
global $context_line_count;
167167

168168
// Temporary for the duration of refactoring
169-
/** @var JUnit */
169+
/** @var JUnit $junit */
170170
global $junit;
171171

172172
define('IS_WINDOWS', substr(PHP_OS, 0, 3) == "WIN");
@@ -465,7 +465,6 @@ function main(): void
465465
case 'g':
466466
$SHOW_ONLY_GROUPS = explode(",", $argv[++$i]);
467467
break;
468-
//case 'h'
469468
case '--keep-all':
470469
foreach ($cfgfiles as $file) {
471470
$cfg['keep'][$file] = true;
@@ -1842,7 +1841,7 @@ function run_test(string $php, $file, array $env): string
18421841
global $show_progress;
18431842

18441843
// Temporary
1845-
/** @var JUnit */
1844+
/** @var JUnit $junit */
18461845
global $junit;
18471846

18481847
static $skipCache;
@@ -3354,9 +3353,8 @@ public function saveXML(): void
33543353
fwrite($this->fp, $xml);
33553354
}
33563355

3357-
private function getSuitesXML(string $suite_name = ''): string
3356+
private function getSuitesXML(): string
33583357
{
3359-
// FIXME: $suite_name gets overwritten
33603358
$result = '';
33613359

33623360
foreach ($this->suites as $suite_name => $suite) {
@@ -3649,10 +3647,10 @@ public function getExtensions(string $php): array
36493647

36503648
class RuntestsValgrind
36513649
{
3652-
protected $version = '';
3653-
protected $header = '';
3654-
protected $version_3_8_0 = false;
3655-
protected $tool = null;
3650+
protected string $version;
3651+
protected string $header;
3652+
protected bool $version_3_8_0;
3653+
protected string $tool;
36563654

36573655
public function getHeader(): string
36583656
{
@@ -3665,7 +3663,7 @@ public function __construct(array $environment, string $tool = 'memcheck')
36653663
$header = system_with_timeout("valgrind --tool={$this->tool} --version", $environment);
36663664
if (!$header) {
36673665
error("Valgrind returned no version info for {$this->tool}, cannot proceed.\n".
3668-
"Please check if Valgrind is installed and the tool is named correctly.");
3666+
"Please check if Valgrind is installed and the tool is named correctly.");
36693667
}
36703668
$count = 0;
36713669
$version = preg_replace("/valgrind-(\d+)\.(\d+)\.(\d+)([.\w_-]+)?(\s+)/", '$1.$2.$3', $header, 1, $count);

0 commit comments

Comments
 (0)