Skip to content

Detect typed class constant dependencies (PHP 8.3)#646

Merged
fain182 merged 1 commit into
mainfrom
claude/issue-643-typed-class-constants
Jul 2, 2026
Merged

Detect typed class constant dependencies (PHP 8.3)#646
fain182 merged 1 commit into
mainfrom
claude/issue-643-typed-class-constants

Conversation

@fain182

@fain182 fain182 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

FileVisitor had no handler reading the type of a Node\Stmt\ClassConst, so the class referenced by a typed constant (const MyClass FOO = null) was never registered as a dependency. Add a handler that reuses the shared type-flattening helper, covering nullable and union constant types as well.

Fixes #643

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

FileVisitor had no handler reading the type of a Node\Stmt\ClassConst,
so the class referenced by a typed constant (const MyClass FOO = null)
was never registered as a dependency. Add a handler that reuses the
shared type-flattening helper, covering nullable and union constant
types as well.

Fixes #643

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 (373909b) to head (8d68db7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

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

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

Typed class constant dependencies are not detected (PHP 8.3)

2 participants