Skip to content

fix(container): use registration keys for cycle tracking - #2330

Open
steffans wants to merge 1 commit into
tempestphp:3.xfrom
steffans:container-registration-cycle-tracking
Open

steffans wants to merge 1 commit into
tempestphp:3.xfrom
steffans:container-registration-cycle-tracking

Conversation

@steffans

@steffans steffans commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Make sure to use registration keys for circular-dependency tracking instead of class names or factory source locations. This prevents false circular-dependency errors in those cases:

  • A tagged singleton depends on an unresolved default singleton of the same type.
  • Separate transient services use factory closures created at the same source location.

I added regression tests for both cases.

@steffans
steffans requested a review from brendt as a code owner November 8, 2026 10:45
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Benchmark Results

Comparison of container-registration-cycle-tracking against 3.x (54b2aa8a9bf4d3cc9b555945f333da0ff4b263ee).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
ContainerBench(benchResolveDefinition) - 4.104mb -0.00% 1.615μs -35.94% ±1.36% +156.74%

Generated by phpbench against commit 45628c9

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.

1 participant