Skip to content

Detect closure and arrow function return type dependencies#645

Merged
fain182 merged 1 commit into
mainfrom
claude/issue-642-closure-return-types
Jul 2, 2026
Merged

Detect closure and arrow function return type dependencies#645
fain182 merged 1 commit into
mainfrom
claude/issue-642-closure-return-types

Conversation

@fain182

@fain182 fain182 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

handleReturnTypeDependency only accepted Node\Stmt\ClassMethod, so return types on closures and arrow functions were silently ignored, while their parameters were already collected. Accept any FunctionLike node and read the type via getReturnType() so all function-like constructs are handled consistently.

Fixes #642

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

handleReturnTypeDependency only accepted Node\Stmt\ClassMethod, so
return types on closures and arrow functions were silently ignored,
while their parameters were already collected. Accept any FunctionLike
node and read the type via getReturnType() so all function-like
constructs are handled consistently.

Fixes #642

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.25%. Comparing base (720aa29) to head (6d120c6).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #645   +/-   ##
=========================================
  Coverage     98.25%   98.25%           
  Complexity      701      701           
=========================================
  Files            87       87           
  Lines          2001     2001           
=========================================
  Hits           1966     1966           
  Misses           35       35           
Files with missing lines Coverage Δ
src/Analyzer/FileVisitor.php 97.89% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fain182 fain182 merged commit 373909b 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.

Closure and arrow function return type dependencies are not detected

2 participants