Extract Autowire utility for shared eligibility checks#79
Merged
Conversation
Consolidates autowire eligibility logic into a reusable Autowire class: - getRequiredDependencyType() validates and returns the type for required params - isParameterAutowirable() checks if a param can be autowired (boolean) - isEligible() checks if a class can be fully autowired Updates DevContainer and AutowiredValue to use the shared utility, reducing code duplication and ensuring consistent behavior. Also filters out Closure and Generator types which cannot meaningfully be autowired from a container. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #79 +/- ##
============================================
+ Coverage 80.97% 82.00% +1.03%
- Complexity 196 207 +11
============================================
Files 26 27 +1
Lines 594 617 +23
============================================
+ Hits 481 506 +25
+ Misses 113 111 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add tests for isParameterAutowirable() and getRequiredDependencyType() methods, including exception cases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for edge cases: - No type hint parameters - Union type parameters - Private constructor classes Remove redundant isPublic() check since isInstantiable() already handles non-public constructors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
178d816 to
20e14a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AutowireclassDevContainerandAutowiredValueto use the shared utilityClosureandGeneratortypes which cannot be autowiredAPI
Motivation
This prepares for #77 (config generator) which needs to check autowire eligibility. Rather than duplicate the logic, this extracts it into a shared utility that all autowiring code can use.
Test plan
🤖 Generated with Claude Code