Respect nullable dependencies and implement dependency resolution for…#30
Respect nullable dependencies and implement dependency resolution for…#30
Conversation
… interceptors and add tests for interceptor functionality
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #30 +/- ##
============================================
- Coverage 99.81% 99.12% -0.70%
- Complexity 391 401 +10
============================================
Files 34 34
Lines 1110 1143 +33
============================================
+ Hits 1108 1133 +25
- Misses 2 10 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| private function resolvePostInterceptor(string $interceptorClass): PostResolutionInterceptorInterface | ||
| { | ||
| $instance = $this->resolver !== null | ||
| ? $this->resolver->resolve($interceptorClass) | ||
| : new $interceptorClass(); |
There was a problem hiding this comment.
Avoid resolving interceptors through interceptor pipeline
Interceptors are now instantiated via $this->resolver->resolve($interceptorClass). Because ServiceResolver::resolve() runs both pre‑ and post‑interceptors, a global interceptor whose supports() method returns true for its own class (e.g. an interceptor that logs every resolved object) will trigger matchPost() while the interceptor is being created. That calls back into resolve() for the same interceptor, tripping the circular dependency guard and preventing the interceptor from being instantiated at all. Previously the code constructed interceptors directly and avoided this recursion. Consider bypassing interceptor invocation when creating interceptor instances (or short‑circuit when the target is the interceptor itself) so self‑supporting interceptors do not deadlock.
Useful? React with 👍 / 👎.
… interceptors and add tests for interceptor functionality