Skip to content

Show circular list of depedencies on circular dependancy error message#886

Merged
mnapoli merged 1 commit into
PHP-DI:masterfrom
bdsl:patch-1
Jul 21, 2024
Merged

Show circular list of depedencies on circular dependancy error message#886
mnapoli merged 1 commit into
PHP-DI:masterfrom
bdsl:patch-1

Conversation

@bdsl

@bdsl bdsl commented Jun 25, 2024

Copy link
Copy Markdown
Contributor

Sometimes it can take a while to trace through the dependencies to find a circle. But the container knows the dependencies its trying to resolve when it throws this error, so outputting that in the exception message should help.

May need a bit more work to only show the circle instead of the full list of dependencies being resolved.

Comment thread src/Container.php Outdated
@mnapoli

mnapoli commented Jun 25, 2024

Copy link
Copy Markdown
Member

Sounds great, can you add a new test to cover this?

@bdsl

bdsl commented Jul 19, 2024

Copy link
Copy Markdown
Contributor Author

Hi @mnapoli! I'm sorry I only just saw your message today. I've edited the existing test assertions to assert on the full new error message. Apologies for the delay. Doing that also lead me to copy the same functionality into the compiled container.

I've rebased onto origin/aster.

@mnapoli

mnapoli commented Jul 21, 2024

Copy link
Copy Markdown
Member

Thank you!

@mnapoli mnapoli merged commit e87435e into PHP-DI:master Jul 21, 2024
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