@@ -471,7 +471,6 @@ function main(): void
471
471
$ cfg ['keep ' ][$ file ] = true ;
472
472
}
473
473
break ;
474
- //case 'l'
475
474
case 'm ' :
476
475
$ valgrind = new RuntestsValgrind ($ environment );
477
476
break ;
@@ -520,7 +519,6 @@ function main(): void
520
519
putenv ('NO_INTERACTION=1 ' );
521
520
$ environment ['NO_INTERACTION ' ] = 1 ;
522
521
break ;
523
- //case 'r'
524
522
case 's ' :
525
523
$ output_file = $ argv [++$ i ];
526
524
$ just_save_results = true ;
@@ -594,7 +592,6 @@ function main(): void
594
592
case '--bless ' :
595
593
$ bless = true ;
596
594
break ;
597
- //case 'w'
598
595
case '- ' :
599
596
// repeat check with full switch
600
597
$ switch = $ argv [$ i ];
@@ -1813,7 +1810,8 @@ function show_file_block(string $file, string $block, ?string $section = null):
1813
1810
}
1814
1811
}
1815
1812
1816
- function skip_test (string $ tested , string $ tested_file , string $ shortname , string $ reason ) {
1813
+ function skip_test (string $ tested , string $ tested_file , string $ shortname , string $ reason ): string
1814
+ {
1817
1815
global $ junit ;
1818
1816
1819
1817
show_result ('SKIP ' , $ tested , $ tested_file , "reason: $ reason " );
@@ -2204,7 +2202,6 @@ function run_test(string $php, $file, array $env): string
2204
2202
return 'SKIPPED ' ;
2205
2203
}
2206
2204
2207
-
2208
2205
if (!strncasecmp ('info ' , $ output , 4 ) && preg_match ('/^info\s*(.+)/i ' , $ output , $ m )) {
2209
2206
$ info = " (info: $ m [1 ]) " ;
2210
2207
} elseif (!strncasecmp ('warn ' , $ output , 4 ) && preg_match ('/^warn\s+(.+)/i ' , $ output , $ m )) {
@@ -2935,8 +2932,7 @@ function generate_diff(string $wanted, ?string $wanted_re, string $output): stri
2935
2932
$ regex = '/^ ' . expectf_to_regex ($ expected ). '$/s ' ;
2936
2933
return preg_match ($ regex , $ new );
2937
2934
});
2938
- $ result = $ differ ->diff ($ w , $ o );
2939
- return $ result ;
2935
+ return $ differ ->diff ($ w , $ o );
2940
2936
}
2941
2937
2942
2938
function error (string $ message ): void
@@ -3358,7 +3354,7 @@ public function saveXML(): void
3358
3354
fwrite ($ this ->fp , $ xml );
3359
3355
}
3360
3356
3361
- private function getSuitesXML (string $ suite_name = '' )
3357
+ private function getSuitesXML (string $ suite_name = '' ): string
3362
3358
{
3363
3359
// FIXME: $suite_name gets overwritten
3364
3360
$ result = '' ;
@@ -3649,17 +3645,6 @@ public function getExtensions(string $php): array
3649
3645
3650
3646
return $ result ;
3651
3647
}
3652
-
3653
- // public function __destruct()
3654
- // {
3655
- // echo "Skips: {$this->hits} hits, {$this->misses} misses.\n";
3656
- // echo "Extensions: {$this->extHits} hits, {$this->extMisses} misses.\n";
3657
- // echo "Cache distribution:\n";
3658
- //
3659
- // foreach ($this->skips as $php => $cache) {
3660
- // echo "$php: " . count($cache) . "\n";
3661
- // }
3662
- // }
3663
3648
}
3664
3649
3665
3650
class RuntestsValgrind
@@ -3669,11 +3654,6 @@ class RuntestsValgrind
3669
3654
protected $ version_3_8_0 = false ;
3670
3655
protected $ tool = null ;
3671
3656
3672
- public function getVersion (): string
3673
- {
3674
- return $ this ->version ;
3675
- }
3676
-
3677
3657
public function getHeader (): string
3678
3658
{
3679
3659
return $ this ->header ;
@@ -3746,17 +3726,6 @@ public function hasSection(string $name): bool
3746
3726
return isset ($ this ->sections [$ name ]);
3747
3727
}
3748
3728
3749
- public function hasAllSections (string ...$ names ): bool
3750
- {
3751
- foreach ($ names as $ section ) {
3752
- if (!isset ($ this ->sections [$ section ])) {
3753
- return false ;
3754
- }
3755
- }
3756
-
3757
- return true ;
3758
- }
3759
-
3760
3729
public function hasAnySections (string ...$ names ): bool
3761
3730
{
3762
3731
foreach ($ names as $ section ) {
@@ -3981,7 +3950,7 @@ final class Differ
3981
3950
public const OLD = 0 ;
3982
3951
public const ADDED = 1 ;
3983
3952
public const REMOVED = 2 ;
3984
- private $ outputBuilder ;
3953
+ private DiffOutputBuilder $ outputBuilder ;
3985
3954
private $ isEqual ;
3986
3955
3987
3956
public function __construct (callable $ isEqual )
@@ -4043,8 +4012,6 @@ public function diffToArray(array $from, array $to): array
4043
4012
4044
4013
foreach ($ end as $ token ) {
4045
4014
$ diff [] = [$ token , self ::OLD ];
4046
- $ fromLine ++;
4047
- $ toLine ++;
4048
4015
}
4049
4016
4050
4017
return $ diff ;
@@ -4163,7 +4130,6 @@ public function getDiff(array $diffs): string
4163
4130
{
4164
4131
global $ context_line_count ;
4165
4132
$ i = 0 ;
4166
- $ string = '' ;
4167
4133
$ number_len = max (3 , strlen ((string )count ($ diffs )));
4168
4134
$ line_number_spec = '%0 ' . $ number_len . 'd ' ;
4169
4135
$ buffer = fopen ('php://memory ' , 'r+b ' );
0 commit comments