Skip to content

Conversation

@judus
Copy link
Owner

@judus judus commented Oct 6, 2025

… interceptors and add tests for interceptor functionality

… interceptors and add tests for interceptor functionality
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 81.81818% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.12%. Comparing base (d1c1acd) to head (cf36125).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/Container/InterceptorRegistry.php 80.95% 8 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@judus judus merged commit 7b7fa7e into master Oct 6, 2025
1 of 3 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Comment on lines +163 to +167
private function resolvePostInterceptor(string $interceptorClass): PostResolutionInterceptorInterface
{
$instance = $this->resolver !== null
? $this->resolver->resolve($interceptorClass)
: new $interceptorClass();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

2 participants