-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Aspect.php #218
Update Aspect.php #218
Conversation
fix instance type error when use AnnotatedWithMatcher
WalkthroughThe change involves modifying the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #218 +/- ##
=============================================
- Coverage 100.00% 91.20% -8.80%
- Complexity 196 230 +34
=============================================
Files 26 27 +1
Lines 512 591 +79
=============================================
+ Hits 512 539 +27
- Misses 0 52 +52 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/Aspect.php (1 hunks)
Additional comments not posted (1)
src/Aspect.php (1)
201-201
: LGTM!The change to use
\Ray\Aop\ReflectionClass
instead of the globalReflectionClass
is approved. It clarifies the source of theReflectionClass
, ensuring the correct implementation is referenced, which is consistent with the PR objective of addressing the instance type error encountered when utilizing theAnnotatedWithMatcher
.
See #218 This commit introduces a new test method `testAnnotateMatcher` to ensure that classes marked with the `FakeClassMarker` annotation are correctly intercepted by the aspect. The method verifies the instance creation and binding of interceptors to annotated classes.
@denise-kao Thanks. It was an easy mistake that should not have happened! |
Released as v2.16.2 |
Fix instance type error when using AnnotatedWithMatcher
In AnnotatedWithMatcher.php, matchesMethod assert $method is \Ray\Aop\ReflectionMethod
But in Aspect.php, using ReflectionMethod as a parameter causes AnnotatedWithMatcher is always not working.
Summary by CodeRabbit
Bug Fixes
ReflectionClass
used in the application to ensure the correct implementation is referenced, enhancing stability and performance.Refactor
ReflectionClass
for better maintainability without altering the existing functionality of the method.