Skip to content

Simplify FileVisitor and dedup property hook param dependencies#647

Merged
fain182 merged 1 commit into
mainfrom
claude/refactor-filevisitor
Jul 2, 2026
Merged

Simplify FileVisitor and dedup property hook param dependencies#647
fain182 merged 1 commit into
mainfrom
claude/refactor-filevisitor

Conversation

@fain182

@fain182 fain182 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Readability refactor with one behavioral fix:

  • Remove handlePropertyHookNode: the traverser already visits hook params as Node\Param, so the dedicated handler registered every set hook param dependency twice. The existing hook param test now asserts the exact dependency list to lock this in.
  • Merge the four copy-paste expression handlers (new, static call, class const fetch, instanceof) into handleClassReferenceExpression.
  • Collapse leaveNode's four identical branches into one ClassLike check.
  • Fold the anonymous class branch into handleClassNode and inline the addParamDependency indirection.
  • Group enterNode handlers by intent (declarations, type declarations, expressions, attributes/docblocks).

No dependency detection behavior changes other than the dedup.

Claude-Session: https://claude.ai/code/session_01VUHWv3r1BJyZj4H1WzM3v9

Readability refactor with one behavioral fix:

- Remove handlePropertyHookNode: the traverser already visits hook
  params as Node\Param, so the dedicated handler registered every set
  hook param dependency twice. The existing hook param test now asserts
  the exact dependency list to lock this in.
- Merge the four copy-paste expression handlers (new, static call,
  class const fetch, instanceof) into handleClassReferenceExpression.
- Collapse leaveNode's four identical branches into one ClassLike check.
- Fold the anonymous class branch into handleClassNode and inline the
  addParamDependency indirection.
- Group enterNode handlers by intent (declarations, type declarations,
  expressions, attributes/docblocks).

No dependency detection behavior changes other than the dedup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VUHWv3r1BJyZj4H1WzM3v9
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.22%. Comparing base (b69b679) to head (1b4195a).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #647      +/-   ##
============================================
- Coverage     98.25%   98.22%   -0.04%     
+ Complexity      704      689      -15     
============================================
  Files            87       87              
  Lines          2008     1968      -40     
============================================
- Hits           1973     1933      -40     
  Misses           35       35              
Files with missing lines Coverage Δ
src/Analyzer/FileVisitor.php 97.45% <100.00%> (-0.52%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fain182 fain182 merged commit 4c06ef1 into main Jul 2, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants