Skip to content

Commit eef8715

Browse files
ondrejmirtesclaude
andcommitted
Drop the pending list from the signature parity check
Every class it listed now matches its twin. NodeTraverser's protected traverseNode()/traverseArray() stay undeclared on purpose — traverse() walks the tree in one native call — and are listed as a deliberate difference with the reason instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Fdg8n3eEi4ZoXa4dA2k4A
1 parent 28da435 commit eef8715

1 file changed

Lines changed: 3 additions & 26 deletions

File tree

‎turbo-ext/tests/signature-parity.php‎

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,6 @@
2626
$root = dirname(__DIR__, 2);
2727
chdir($root);
2828

29-
/**
30-
* Classes whose native declaration still drifts from the twin — class =>
31-
* reason. Their problems are listed but do not fail the check; an entry
32-
* whose class matches is reported as stale.
33-
*
34-
* @var array<string, string>
35-
*/
36-
$knownDrift = [
37-
'PhpParser\\NodeTraverser' => 'pending',
38-
];
39-
4029
/**
4130
* Single differences a native class keeps on purpose — class => [pattern
4231
* matched against the problem text => reason]. A pattern that matches no
@@ -45,6 +34,9 @@
4534
* @var array<string, array<string, string>>
4635
*/
4736
$deliberateDrift = [
37+
'PhpParser\\NodeTraverser' => [
38+
'~^method (traverseNode|traverseArray) is not declared natively$~' => 'traverse() walks the tree in one native call with its visitor plan; the protected recursion steps exist only inside it (neither PHPStan nor php-parser subclasses NodeTraverser)',
39+
],
4840
'PHPStan\\Analyser\\ExpressionResultStorage' => [
4941
'~^property (exprResults is not declared natively|(exprsById|resultsById) is declared natively but not in PHP)$~' => 'the result table is two id-keyed arrays instead of the twin\'s SplObjectStorage',
5042
],
@@ -293,7 +285,6 @@ function compareMembers(string $kind, string $className, array $native, array $t
293285

294286
$failed = false;
295287
$compared = 0;
296-
$staleDrift = [];
297288
foreach ($manifest as $twinClass => $entry) {
298289
$twin = $twins[$twinClass];
299290
$native = $natives[$twinClass];
@@ -345,16 +336,6 @@ function compareMembers(string $kind, string $className, array $native, array $t
345336
}
346337
$problems = array_values($problems);
347338

348-
if (isset($knownDrift[$twinClass])) {
349-
if ($problems === []) {
350-
$staleDrift[] = $twinClass;
351-
continue;
352-
}
353-
foreach ($problems as $problem) {
354-
printf("~ %s: %s (known: %s)\n", $twinClass, $problem, $knownDrift[$twinClass]);
355-
}
356-
continue;
357-
}
358339
if ($problems === []) {
359340
printf("✓ %s\n", $twinClass);
360341
continue;
@@ -364,10 +345,6 @@ function compareMembers(string $kind, string $className, array $native, array $t
364345
printf("✗ %s: %s\n", $twinClass, $problem);
365346
}
366347
}
367-
foreach ($staleDrift as $className) {
368-
$failed = true;
369-
printf("✗ %s matches its twin — remove it from \$knownDrift\n", $className);
370-
}
371348

372349
printf($failed ? "FAILED\n" : "OK (%d members compared)\n", $compared);
373350
exit($failed ? 1 : 0);

0 commit comments

Comments
 (0)